Worklet: Merge (MainThread/Threaded)WorkletGlobalScope into WorkletGlobalScope
This is a cleanup CL to merge MainThreadWorkletGlobalScope and
ThreadedWorkletGlobalScope into WorkletGlobalScope for shallowing the class
hierarchy of WorkletGlobalScope and making it more extensible.
========== Details ==========
Before this CL, WorkletGlobalScope has the following class hierarchy.
MainThreadWorkletGlobalScope and ThreadedWorkletGlobalScope implement thread
specific things, for example, GetTaskRunner().
- WorkerOrWorkletGlobalScope
- WorkletGlobalScope
- MainThreadWorkletGlobalScope
- PaintWorkletGlobalScope
- LayoutWorkletGlobalScope
- ThreadedWorkletGlobalScope
- AudioWorkletGlobalScope
- AnimationWorkletGlobalScope
This separation has been worked well until now because each subclass of
WorkletGlobalScope runs only on a specific thread (i.e., the main thread or a
worker thread). However, the situation has been changed. We started implementing
off-the-main-thread PaintWorklet (See https://crbug.com/829967) and noticed
this separation makes it so difficult to enable PaintWorklet to run on both the
main thread and a worker thread.
To mitigate the difficulty, this CL merges them into WorkletGlobalScope. After
this CL, the class hierarchy looks like this:
- WorkerOrWorkletGlobalScope
- WorkletGlobalScope
- PaintWorkletGlobalScope
- LayoutWorkletGlobalScope
- AudioWorkletGlobalScope
- AnimationWorkletGlobalScope
In this new hierarchy, WorkletGlobalScope implements thread specific things, and
provides multiple constructors for its subclasses to specify thread affinity.
Bug: 893478
Change-Id: Iad817c7dd10ce5bd51a4c381fbd34aa1669454f7
Reviewed-on: https://chromium-review.googlesource.com/c/1272416Reviewed-by:
Kentaro Hara <haraken@chromium.org>
Reviewed-by:
Makoto Shimazu <shimazu@chromium.org>
Reviewed-by:
Matt Falkenhagen <falken@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#598779}
Showing
Please register or sign in to comment