Bug 204397 - MicrotaskQueue should be accessed via EventLoop
Summary: MicrotaskQueue should be accessed via EventLoop
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on:
Blocks: 204042
  Show dependency treegraph
 
Reported: 2019-11-19 23:05 PST by Ryosuke Niwa
Modified: 2019-11-20 19:34 PST (History)
15 users (show)

See Also:


Attachments
Refactoring (42.77 KB, patch)
2019-11-19 23:31 PST, Ryosuke Niwa
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2019-11-19 23:05:37 PST
In order to integrate MicrotaskQueue, refactor the existing code to always access it via EventLoop.
Comment 1 Ryosuke Niwa 2019-11-19 23:31:23 PST
Created attachment 383948 [details]
Refactoring
Comment 2 Radar WebKit Bug Importer 2019-11-19 23:33:46 PST
<rdar://problem/57351294>
Comment 3 Ryosuke Niwa 2019-11-19 23:45:25 PST
Once this patch is landed, there are a few bugs to fix:
 - MutationObserver's compound microtask queue must be per similar origin windows; i.e. per event loop. This should let us remove the hack we added in https://trac.webkit.org/r247222.
 - Custom Element's backup queue must be per micro per similar origin windows; i.e. per event loop. This will be observable via editing commands issued across sites.
 - EventLoopTaskQueue::queueMicrotaskCallback should automatically suspend or stop microtasks if the associated script execution context is suspend or stopped like regular EventLoopTasks. This will let us remove ActiveDOMCallbackMicrotask.
Comment 4 Antti Koivisto 2019-11-20 01:39:53 PST
Comment on attachment 383948 [details]
Refactoring

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

> Source/WebCore/dom/MutationObserver.cpp:163
> +// This state must be per event loop.
> +static bool mutationObserverCompoundMicrotaskQueuedFlag = false;

I suppose this is a FIXME.

> Source/WebCore/dom/WindowEventLoop.cpp:78
> +    // MicrotaskQueue must be one per event loop.

FIXME
Comment 5 Ryosuke Niwa 2019-11-20 17:47:58 PST
Committed r252723: <https://trac.webkit.org/changeset/252723>
Comment 6 Fujii Hironori 2019-11-20 19:34:45 PST
Filed: Bug 204437 – [MSVC] error C2039: 'weakPtrFactory': is not a member of 'WebCore::DocumentStorageAccess::requestStorageAccess::<lambda_3f2cfd7704f93d8fe19d5b5f064f8add>'