Introduce WorkerMessagePortChannelRegistry
Created attachment 377689 [details] Patch
Created attachment 377690 [details] Patch
Comment on attachment 377690 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=377690&action=review > Source/WebCore/dom/MessagePort.cpp:252 > + auto scopeExit = makeScopeExit([&completionCallback] { > + completionCallback(); > + }); Why make a lambda that calls the Function instead of just using the Function itself? Why no WTFMove? Also, this seems like it should be a CompletionHandler. > Source/WebCore/dom/MessagePort.cpp:315 > + callOnMainThread([remoteIdentifier = m_remoteIdentifier, weakThis = makeWeakPtr(const_cast<MessagePort*>(this)), workerThread = WTFMove(workerThread)]() mutable { makeWeakPtr should take const T& instead of non-const T& and this const_cast shouldn't be necessary. Same with const T*
Created attachment 377829 [details] Patch
Created attachment 377839 [details] Patch for landing
(In reply to Alex Christensen from comment #3) > Comment on attachment 377690 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=377690&action=review > > > Source/WebCore/dom/MessagePort.cpp:252 > > + auto scopeExit = makeScopeExit([&completionCallback] { > > + completionCallback(); > > + }); > > Why make a lambda that calls the Function instead of just using the Function > itself? Why no WTFMove? Also, this seems like it should be a > CompletionHandler. Right. > > Source/WebCore/dom/MessagePort.cpp:315 > > + callOnMainThread([remoteIdentifier = m_remoteIdentifier, weakThis = makeWeakPtr(const_cast<MessagePort*>(this)), workerThread = WTFMove(workerThread)]() mutable { > > makeWeakPtr should take const T& instead of non-const T& and this const_cast > shouldn't be necessary. Same with const T* makeWeakPtr can take a const pointer as input but it will create a WeakPtr of a const pointer. In that case, we want to have a non const weakThis to call updateActivity.
Comment on attachment 377839 [details] Patch for landing Clearing flags on attachment: 377839 Committed r249378: <https://trac.webkit.org/changeset/249378>
All reviewed patches have been landed. Closing bug.
<rdar://problem/54945252>