RESOLVED FIXED 222965
Make RTCDataChannel transferable
https://bugs.webkit.org/show_bug.cgi?id=222965
Summary Make RTCDataChannel transferable
youenn fablet
Reported 2021-03-09 00:39:34 PST
This would allow to use RTCDataChannel in workers, thus allowing to process/send messages without being blocked on main thread.
Attachments
Patch (60.91 KB, patch)
2021-03-09 01:12 PST, youenn fablet
no flags
Patch (47.05 KB, patch)
2021-03-11 01:18 PST, youenn fablet
no flags
Patch for landing (48.02 KB, patch)
2021-03-12 02:16 PST, youenn fablet
no flags
youenn fablet
Comment 1 2021-03-09 01:12:10 PST
youenn fablet
Comment 2 2021-03-11 01:18:31 PST
Eric Carlson
Comment 3 2021-03-11 09:07:42 PST
Comment on attachment 422914 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=422914&action=review > Source/WebCore/Modules/mediastream/RTCDataChannel.cpp:68 > + if (!channel->m_handler) > + return; Is this unexpected? If so, it may be worth logging an error to help track down errors later. > Source/WebCore/Modules/mediastream/RTCDataChannel.cpp:270 > + ASSERT(m_isDetachable); Maybe ASSERT(canDetach())? > Source/WebCore/Modules/mediastream/RTCDataChannel.cpp:295 > + if (identifier.processIdentifier != Process::identifier()) { > + // FIXME: Add support for out-of-process data channels. > + return createClosedChannel(context, WTFMove(label), WTFMove(options)); > + } Maybe log an error here to help diagnose error reports? > Source/WebCore/Modules/mediastream/RTCDataChannel.cpp:301 > + if (!handler) > + return createClosedChannel(context, WTFMove(label), WTFMove(options)); Ditto
youenn fablet
Comment 4 2021-03-12 01:27:44 PST
Comment on attachment 422914 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=422914&action=review >> Source/WebCore/Modules/mediastream/RTCDataChannel.cpp:68 >> + return; > > Is this unexpected? If so, it may be worth logging an error to help track down errors later. It is not unexpected, in case a channel is created and closed immediately. >> Source/WebCore/Modules/mediastream/RTCDataChannel.cpp:270 >> + ASSERT(m_isDetachable); > > Maybe ASSERT(canDetach())? Yep, sounds much better! And I will add that bufferedAmount is zero as well. >> Source/WebCore/Modules/mediastream/RTCDataChannel.cpp:295 >> + } > > Maybe log an error here to help diagnose error reports? OK, will do. >> Source/WebCore/Modules/mediastream/RTCDataChannel.cpp:301 >> + return createClosedChannel(context, WTFMove(label), WTFMove(options)); > > Ditto For this one, it would be an error right now, but in the future if the connection gets closed before the transfer happens, we could end up in that case.
youenn fablet
Comment 5 2021-03-12 02:16:59 PST
Created attachment 423025 [details] Patch for landing
EWS
Comment 6 2021-03-12 05:19:14 PST
Committed r274351: <https://commits.webkit.org/r274351> All reviewed patches have been landed. Closing bug and clearing flags on attachment 423025 [details].
Radar WebKit Bug Importer
Comment 7 2021-03-12 05:20:15 PST
Note You need to log in before you can comment on or make changes to this bug.