Bug 234883 - WorkerMessagePortChannelProvider::takeAllMessagesForPort should guarantee execution of the takeMessagePort callback
Summary: WorkerMessagePortChannelProvider::takeAllMessagesForPort should guarantee exe...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-01-05 08:11 PST by youenn fablet
Modified: 2022-01-06 02:51 PST (History)
6 users (show)

See Also:


Attachments
Patch (3.95 KB, patch)
2022-01-05 08:14 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (3.97 KB, patch)
2022-01-06 02:04 PST, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2022-01-05 08:11:18 PST
WorkerMessagePortChannelProvider::takeAllMessagesForPort should guarantee execution of the takeMessagePort callback
Comment 1 youenn fablet 2022-01-05 08:11:30 PST
<rdar://86708232>
Comment 2 youenn fablet 2022-01-05 08:14:28 PST
Created attachment 448388 [details]
Patch
Comment 3 Alex Christensen 2022-01-05 11:42:08 PST
Comment on attachment 448388 [details]
Patch

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

> Source/WebCore/dom/messageports/WorkerMessagePortChannelProvider.cpp:110
> +    Function<void()> m_completionHandler;

Can this be a CompletionHandler?

> Source/WebCore/dom/messageports/WorkerMessagePortChannelProvider.cpp:119
>          MessagePortChannelProvider::singleton().takeAllMessagesForPort(identifier, [this, workerThread = WTFMove(workerThread), callbackIdentifier](Vector<MessageWithMessagePorts>&& messages, Function<void()>&& completionHandler) {

ditto
Comment 4 youenn fablet 2022-01-06 01:33:43 PST
(In reply to Alex Christensen from comment #3)
> Comment on attachment 448388 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=448388&action=review
> 
> > Source/WebCore/dom/messageports/WorkerMessagePortChannelProvider.cpp:110
> > +    Function<void()> m_completionHandler;
> 
> Can this be a CompletionHandler?

Yes, will change it.

> > Source/WebCore/dom/messageports/WorkerMessagePortChannelProvider.cpp:119
> >          MessagePortChannelProvider::singleton().takeAllMessagesForPort(identifier, [this, workerThread = WTFMove(workerThread), callbackIdentifier](Vector<MessageWithMessagePorts>&& messages, Function<void()>&& completionHandler) {
> 
> ditto

It seems so, and this might be good given that probably makes sure we do not accumulate data in the networking process.
We should do that in a separate patch though.
Comment 5 youenn fablet 2022-01-06 02:04:14 PST
Created attachment 448473 [details]
Patch for landing
Comment 6 EWS 2022-01-06 02:51:10 PST
Committed r287679 (245776@main): <https://commits.webkit.org/245776@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 448473 [details].