Bug 211291

Summary: Sending WebRTC network packets should not go through the main thread
Product: WebKit Reporter: youenn fablet <youennf>
Component: WebRTCAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, eric.carlson, esprehn+autocc, ews-watchlist, glenn, hta, jer.noble, kangil.han, philipj, sergio, tommyw, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch for landing
none
Patch for landing none

Description youenn fablet 2020-05-01 07:33:07 PDT
Sending WebRTC network packets should not go through the main thread
Comment 1 youenn fablet 2020-05-01 07:36:00 PDT
Created attachment 398182 [details]
Patch
Comment 2 Eric Carlson 2020-05-01 09:29:29 PDT
Comment on attachment 398182 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=398182&action=review

> Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.cpp:61
>  void LibWebRTCSocket::sendOnMainThread(Function<void(IPC::Connection&)>&& callback)

Should this be renamed now that it doesn't send on the main thread?
Comment 3 youenn fablet 2020-05-01 09:41:25 PDT
(In reply to Eric Carlson from comment #2)
> Comment on attachment 398182 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=398182&action=review
> 
> > Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.cpp:61
> >  void LibWebRTCSocket::sendOnMainThread(Function<void(IPC::Connection&)>&& callback)
> 
> Should this be renamed now that it doesn't send on the main thread?

Right, we also need a better handling of getting the IPC::Connection.
The callOnMainThreadAndWait should be removed to ensure we do not end up in a deadlock.
Comment 4 youenn fablet 2020-05-05 08:17:31 PDT
Created attachment 398508 [details]
Patch
Comment 5 youenn fablet 2020-05-05 08:26:31 PDT
Created attachment 398509 [details]
Patch
Comment 6 youenn fablet 2020-05-06 05:49:13 PDT
Created attachment 398604 [details]
Patch
Comment 7 youenn fablet 2020-05-06 07:42:21 PDT
Created attachment 398612 [details]
Patch
Comment 8 youenn fablet 2020-05-06 07:48:09 PDT
Created attachment 398613 [details]
Patch
Comment 9 Eric Carlson 2020-05-06 09:44:32 PDT
Comment on attachment 398613 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=398613&action=review

> Source/WebCore/ChangeLog:12
> +        Fix a case where the SDP would be badly formatted we do not have yet a MDNS name for the corresponding IP address.

s/would be badly formatted we do not have yet a MDNS name/would be badly formatted if we do not yet have an MDNS name/

> Source/WebCore/ChangeLog:13
> +        Small refactoring to use less else if

s/use less else if/use early returns/
Comment 10 youenn fablet 2020-05-06 10:22:08 PDT
Created attachment 398634 [details]
Patch for landing
Comment 11 youenn fablet 2020-05-07 01:56:28 PDT
Created attachment 398714 [details]
Patch for landing
Comment 12 EWS 2020-05-07 02:23:48 PDT
Committed r261277: <https://trac.webkit.org/changeset/261277>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 398714 [details].
Comment 13 Radar WebKit Bug Importer 2020-05-07 02:24:16 PDT
<rdar://problem/62967836>