New issue
Advanced search Search tips

Issue 727194 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Feature

Blocking:
issue 467782
issue 469639



Sign in to add a comment

Introduce module script loading in threaded worklets

Project Member Reported by nhiroki@chromium.org, May 29 2017

Issue description

Threaded worklets (i.e., AnimationWorklet, AudioWorklet) should load its script as a module script, but in the current implementation, it's loaded as a classic script like workers.

Module script loading was already enabled for main thread worklets (see  issue 627945 ). We should be able to reuse most of the codes for threaded worklets.
 
Status: Started (was: Assigned)
Project Member

Comment 2 by bugdroid1@chromium.org, May 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/315dddc6bbfe2ca11f6d3b127f02e5fc66d71aae

commit 315dddc6bbfe2ca11f6d3b127f02e5fc66d71aae
Author: nhiroki <nhiroki@chromium.org>
Date: Tue May 30 07:53:09 2017

Worklet: Enqueue tasks into outsideSetting's event loop

The Worklet spec requires some of tasks during addModule() algorithm are
enqueued into the outsideSetting's event loop. From implementation point of
view, this corresponds to parent frame's task runners. This CL introduces the
parent frame task runners for such places.

Note that in the current implementation all code related to addModule() run on
the main thread because only the main thread worklets support module loading, so
technically this change is not necessary for now. This change will be really
necessary when the threaded worklets also support module loading to jump over
the thread boundary between the main thread and worklet's context thread.

There are no unit tests, but layout tests confirm this change doesn't break any
thing.

Spec: https://drafts.css-houdini.org/worklets/#dom-worklet-addmodule
DesignDoc: https://docs.google.com/document/d/1cgLcrua7H_7x_o5GlzYrAi2qt-TqTzgtOeixFAugR6g/edit?usp=sharing

BUG= 727194 

Review-Url: https://codereview.chromium.org/2910953002
Cr-Commit-Position: refs/heads/master@{#475456}

[modify] https://crrev.com/315dddc6bbfe2ca11f6d3b127f02e5fc66d71aae/third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp
[modify] https://crrev.com/315dddc6bbfe2ca11f6d3b127f02e5fc66d71aae/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp
[modify] https://crrev.com/315dddc6bbfe2ca11f6d3b127f02e5fc66d71aae/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h
[modify] https://crrev.com/315dddc6bbfe2ca11f6d3b127f02e5fc66d71aae/third_party/WebKit/Source/core/workers/ThreadedWorklet.cpp
[modify] https://crrev.com/315dddc6bbfe2ca11f6d3b127f02e5fc66d71aae/third_party/WebKit/Source/core/workers/ThreadedWorklet.h
[modify] https://crrev.com/315dddc6bbfe2ca11f6d3b127f02e5fc66d71aae/third_party/WebKit/Source/core/workers/WorkletGlobalScopeProxy.h
[modify] https://crrev.com/315dddc6bbfe2ca11f6d3b127f02e5fc66d71aae/third_party/WebKit/Source/core/workers/WorkletModuleTreeClient.cpp
[modify] https://crrev.com/315dddc6bbfe2ca11f6d3b127f02e5fc66d71aae/third_party/WebKit/Source/core/workers/WorkletModuleTreeClient.h
[modify] https://crrev.com/315dddc6bbfe2ca11f6d3b127f02e5fc66d71aae/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.cpp
[modify] https://crrev.com/315dddc6bbfe2ca11f6d3b127f02e5fc66d71aae/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.h

Project Member

Comment 3 by bugdroid1@chromium.org, May 31 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/dfeea2c19e959507e49d5b4f94d44f59c6653b69

commit dfeea2c19e959507e49d5b4f94d44f59c6653b69
Author: Hiroki Nakagawa <nhiroki@chromium.org>
Date: Wed May 31 05:32:54 2017

Worklet: Move loader client impl from ThreadedWorklet to ThreadedWorkletMessagingProxy

This is an initial step to merge MainThreadWorklet and ThreadedWorklet into
Worklet. No tests added, no behavior change.

In the current implementation, ThreadedWorklet implements the loader client for
classic script loading. That's blocking the merge effort. This CL moves the
client implementation from ThreadedWorklet to ThreadedWorkletMessagingProxy as
LoaderClient and reduces differences between MainThreadWorklet and
ThreadedWorklet.

DesignDoc: https://docs.google.com/document/d/1cgLcrua7H_7x_o5GlzYrAi2qt-TqTzgtOeixFAugR6g/edit?usp=sharing

Bug:  727194 
Change-Id: I9b9adc04ff5a633a2d9afef3ded6a2f57b89e6ba
Reviewed-on: https://chromium-review.googlesource.com/517454
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#475813}
[modify] https://crrev.com/dfeea2c19e959507e49d5b4f94d44f59c6653b69/third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp
[modify] https://crrev.com/dfeea2c19e959507e49d5b4f94d44f59c6653b69/third_party/WebKit/Source/core/workers/ThreadedWorklet.cpp
[modify] https://crrev.com/dfeea2c19e959507e49d5b4f94d44f59c6653b69/third_party/WebKit/Source/core/workers/ThreadedWorklet.h
[modify] https://crrev.com/dfeea2c19e959507e49d5b4f94d44f59c6653b69/third_party/WebKit/Source/core/workers/ThreadedWorkletMessagingProxy.cpp
[modify] https://crrev.com/dfeea2c19e959507e49d5b4f94d44f59c6653b69/third_party/WebKit/Source/core/workers/ThreadedWorkletMessagingProxy.h
[modify] https://crrev.com/dfeea2c19e959507e49d5b4f94d44f59c6653b69/third_party/WebKit/Source/core/workers/Worklet.cpp
[modify] https://crrev.com/dfeea2c19e959507e49d5b4f94d44f59c6653b69/third_party/WebKit/Source/core/workers/Worklet.h
[modify] https://crrev.com/dfeea2c19e959507e49d5b4f94d44f59c6653b69/third_party/WebKit/Source/core/workers/WorkletGlobalScopeProxy.h
[modify] https://crrev.com/dfeea2c19e959507e49d5b4f94d44f59c6653b69/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.cpp
[modify] https://crrev.com/dfeea2c19e959507e49d5b4f94d44f59c6653b69/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.h

Project Member

Comment 4 by bugdroid1@chromium.org, Jun 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d7d3d2fee88d26f0e6cb0fd224db028718813eb2

commit d7d3d2fee88d26f0e6cb0fd224db028718813eb2
Author: Hiroki Nakagawa <nhiroki@chromium.org>
Date: Thu Jun 01 10:33:31 2017

Worklet: Provide WorkerFetchContext for threaded worklets

This is a preparation CL for module loading for threaded worklets that is going
to be implemented on the off-main-thread-fetch feature.

This change provides WorkerFetchContext that is necessary for the
off-main-thread-fetch to worklet global scopes. The context is created on the
main thread before starting a worklet global scope and passed to worklet's
thread as WorkerThreadStartupData.

Note that this CL does not change the current script loading mechanism for
worklets yet.

Bug:  727194 
Change-Id: I695bf8f64a583ac845a2d0a13076fda0667d8604
Reviewed-on: https://chromium-review.googlesource.com/519022
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#476246}
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/core/loader/WorkerFetchContext.h
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.h
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/core/workers/ThreadedMessagingProxyBase.cpp
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/core/workers/ThreadedMessagingProxyBase.h
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/core/workers/ThreadedWorkletGlobalScope.cpp
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/core/workers/ThreadedWorkletGlobalScope.h
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/core/workers/ThreadedWorkletMessagingProxy.cpp
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/core/workers/ThreadedWorkletMessagingProxy.h
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/core/workers/ThreadedWorkletTest.cpp
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/core/workers/WorkerClients.h
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/core/workers/WorkletGlobalScope.cpp
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/core/workers/WorkletGlobalScope.h
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.cpp
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScope.cpp
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScope.h
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletMessagingProxy.cpp
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletMessagingProxy.h
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletThread.cpp
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/modules/webaudio/AudioWorklet.cpp
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.cpp
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.h
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/modules/webaudio/AudioWorkletMessagingProxy.cpp
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/modules/webaudio/AudioWorkletMessagingProxy.h
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/modules/webaudio/AudioWorkletThread.cpp
[modify] https://crrev.com/d7d3d2fee88d26f0e6cb0fd224db028718813eb2/third_party/WebKit/Source/web/DedicatedWorkerMessagingProxyProviderImpl.cpp

Project Member

Comment 5 by bugdroid1@chromium.org, Jun 2 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7ff9fb254930a40f137964a45eb3d5d8fd159e9d

commit 7ff9fb254930a40f137964a45eb3d5d8fd159e9d
Author: Hiroki Nakagawa <nhiroki@chromium.org>
Date: Fri Jun 02 04:33:48 2017

Worklet: Merge MainThreadWorklet into Worklet

This CL merges MainThreadWorklet into Worklet to make the implementation
reusable for threaded worklets. ThreadedWorklet will be merged into Worklet in
following CLs.

No tests added, no behavior change.

Bug:  727194 
Change-Id: I6628b851e011e06eb3a1199de48744cb81673d98
Reviewed-on: https://chromium-review.googlesource.com/518607
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#476565}
[modify] https://crrev.com/7ff9fb254930a40f137964a45eb3d5d8fd159e9d/third_party/WebKit/Source/core/workers/BUILD.gn
[delete] https://crrev.com/f7b41941ac3c3e7a42d743e5bbae6fe5024edee8/third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp
[delete] https://crrev.com/f7b41941ac3c3e7a42d743e5bbae6fe5024edee8/third_party/WebKit/Source/core/workers/MainThreadWorklet.h
[modify] https://crrev.com/7ff9fb254930a40f137964a45eb3d5d8fd159e9d/third_party/WebKit/Source/core/workers/ThreadedWorklet.cpp
[modify] https://crrev.com/7ff9fb254930a40f137964a45eb3d5d8fd159e9d/third_party/WebKit/Source/core/workers/ThreadedWorklet.h
[modify] https://crrev.com/7ff9fb254930a40f137964a45eb3d5d8fd159e9d/third_party/WebKit/Source/core/workers/Worklet.cpp
[modify] https://crrev.com/7ff9fb254930a40f137964a45eb3d5d8fd159e9d/third_party/WebKit/Source/core/workers/Worklet.h
[modify] https://crrev.com/7ff9fb254930a40f137964a45eb3d5d8fd159e9d/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp
[modify] https://crrev.com/7ff9fb254930a40f137964a45eb3d5d8fd159e9d/third_party/WebKit/Source/modules/csspaint/PaintWorklet.h

Project Member

Comment 6 by bugdroid1@chromium.org, Jun 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/19663e1dc06313c083dd486197f7a303b55f6577

commit 19663e1dc06313c083dd486197f7a303b55f6577
Author: Hiroki Nakagawa <nhiroki@chromium.org>
Date: Thu Jun 15 04:29:16 2017

Worker: Make ThreadedMessagingProxyBase and WorkletGlobalScopeProxy GC-managed objects

Primary motivation of this change is to make WorkletGlobalScopeProxy GC-managed
so that GC-graphs are unified, and to simplify proxy lifetime management for
merging ThreadedWorklet into Worklet.

To achieve this, we also need to make ThreadedMessagingProxyBase GC-managed
because a proxy for worklets implements both the interfaces and is differently
handled depending on an accessor class: a class shared among workers/worklets
handles the proxy as ThreadedMessagingProxyBase and a worklet-specific class
handles it as WorkletGlobalScopeProxy.

<Class hierarchy>

ThreadedMessagingProxyBase
  <- InProcessWorkerMessagingProxy
    <- DedicatedWorkerMessagingProxy
    <- CompositorWorkerMessagingProxy
  <- ThreadedWorkletMessagingProxy
    <- ThreadedWorkletMessagingProxy (also implements WorkletGlobalScopeProxy)
      <- AnimationWorkletMessagingProxy
      <- AudioWorkletMessagingProxy

Bug:  719775 ,  727194 
Change-Id: I7f63bfc4f69009b57f08599241ea3c8801e65a77
Reviewed-on: https://chromium-review.googlesource.com/527716
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#479603}
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/core/workers/DedicatedWorkerMessagingProxy.h
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/core/workers/DedicatedWorkerTest.cpp
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/core/workers/InProcessWorkerBase.h
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.h
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.cpp
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.h
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/core/workers/ThreadedMessagingProxyBase.cpp
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/core/workers/ThreadedMessagingProxyBase.h
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/core/workers/ThreadedObjectProxyBase.h
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/core/workers/ThreadedWorklet.cpp
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/core/workers/ThreadedWorklet.h
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/core/workers/ThreadedWorkletMessagingProxy.cpp
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/core/workers/ThreadedWorkletMessagingProxy.h
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.cpp
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.h
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/core/workers/ThreadedWorkletTest.cpp
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/core/workers/Worklet.cpp
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/core/workers/Worklet.h
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/core/workers/WorkletGlobalScopeProxy.h
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.cpp
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.h
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletMessagingProxy.cpp
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletMessagingProxy.h
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerMessagingProxy.h
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/modules/csspaint/PaintWorklet.h
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.cpp
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.h
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/modules/csspaint/PaintWorkletTest.cpp
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/modules/webaudio/AudioWorklet.cpp
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/modules/webaudio/AudioWorklet.h
[modify] https://crrev.com/19663e1dc06313c083dd486197f7a303b55f6577/third_party/WebKit/Source/modules/webaudio/AudioWorkletMessagingProxy.h

Project Member

Comment 7 by bugdroid1@chromium.org, Jun 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8f9e4bf115f530b797a615fdecd5711845fec39f

commit 8f9e4bf115f530b797a615fdecd5711845fec39f
Author: Hiroki Nakagawa <nhiroki@chromium.org>
Date: Fri Jun 16 08:01:24 2017

Worklet: Merge ThreadedWorklet into Worklet

As a cleanup, this CL merges ThreadedWorklet into Worklet.

Bonus: This enables Worklet to transparently handle messaging proxies to
MainThreadWorkletGlobalScope and ThreadedWorkletGlobalScope. This would be
useful when we support ThreadedPaintWorklet and MainThreadAnimationWorklet
later.

Bug:  727194 
Change-Id: I090597616b4e7dd7bea82b4111de5910857da306
Reviewed-on: https://chromium-review.googlesource.com/518643
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#479988}
[modify] https://crrev.com/8f9e4bf115f530b797a615fdecd5711845fec39f/third_party/WebKit/Source/core/workers/BUILD.gn
[delete] https://crrev.com/e1b10b8ab263cdf7846de378f2782985c3dd07eb/third_party/WebKit/Source/core/workers/ThreadedWorklet.cpp
[delete] https://crrev.com/e1b10b8ab263cdf7846de378f2782985c3dd07eb/third_party/WebKit/Source/core/workers/ThreadedWorklet.h
[modify] https://crrev.com/8f9e4bf115f530b797a615fdecd5711845fec39f/third_party/WebKit/Source/core/workers/ThreadedWorkletMessagingProxy.cpp
[modify] https://crrev.com/8f9e4bf115f530b797a615fdecd5711845fec39f/third_party/WebKit/Source/core/workers/ThreadedWorkletMessagingProxy.h
[modify] https://crrev.com/8f9e4bf115f530b797a615fdecd5711845fec39f/third_party/WebKit/Source/core/workers/Worklet.cpp
[modify] https://crrev.com/8f9e4bf115f530b797a615fdecd5711845fec39f/third_party/WebKit/Source/core/workers/Worklet.h
[modify] https://crrev.com/8f9e4bf115f530b797a615fdecd5711845fec39f/third_party/WebKit/Source/core/workers/WorkletGlobalScopeProxy.h
[modify] https://crrev.com/8f9e4bf115f530b797a615fdecd5711845fec39f/third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.cpp
[modify] https://crrev.com/8f9e4bf115f530b797a615fdecd5711845fec39f/third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.h
[modify] https://crrev.com/8f9e4bf115f530b797a615fdecd5711845fec39f/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.cpp
[modify] https://crrev.com/8f9e4bf115f530b797a615fdecd5711845fec39f/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.h
[modify] https://crrev.com/8f9e4bf115f530b797a615fdecd5711845fec39f/third_party/WebKit/Source/modules/webaudio/AudioWorklet.cpp
[modify] https://crrev.com/8f9e4bf115f530b797a615fdecd5711845fec39f/third_party/WebKit/Source/modules/webaudio/AudioWorklet.h

Project Member

Comment 8 by bugdroid1@chromium.org, Jul 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0027a85a8ff060847bc8f9c95e7bff7c20efc172

commit 0027a85a8ff060847bc8f9c95e7bff7c20efc172
Author: Hiroki Nakagawa <nhiroki@chromium.org>
Date: Fri Jul 28 01:56:53 2017

Worklet: Move MainThreadWorkletGlobalScope::FetchAndInvokeScript() to its parent class

This is a preparation CL for introducing module loading for threaded worklets.
This simply moves the function and shouldn't change the existing behavior, so
this doesn't add new tests.

FetchAndInvokeScript() is the entry point of module loading for worklets, and
it's now implemented in MainThreadWorkletGlobalScope. To make it reusable for
threaded worklets, this CL moves the function to the common parent class among
MainThreadWorkletGlobalScope and ThreadedWorkletGlobalScope.

DesignDoc: https://docs.google.com/document/d/1cgLcrua7H_7x_o5GlzYrAi2qt-TqTzgtOeixFAugR6g/edit?usp=sharing

Bug:  727194 
Change-Id: I51cd437321ccbe569fc6a874812e90e07d4e0ac6
Reviewed-on: https://chromium-review.googlesource.com/588871
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490199}
[modify] https://crrev.com/0027a85a8ff060847bc8f9c95e7bff7c20efc172/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp
[modify] https://crrev.com/0027a85a8ff060847bc8f9c95e7bff7c20efc172/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h
[modify] https://crrev.com/0027a85a8ff060847bc8f9c95e7bff7c20efc172/third_party/WebKit/Source/core/workers/WorkletGlobalScope.cpp
[modify] https://crrev.com/0027a85a8ff060847bc8f9c95e7bff7c20efc172/third_party/WebKit/Source/core/workers/WorkletGlobalScope.h

Project Member

Comment 9 by bugdroid1@chromium.org, Aug 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/890685b158cc617d78039205988dc3ac04c2e29d

commit 890685b158cc617d78039205988dc3ac04c2e29d
Author: Hiroki Nakagawa <nhiroki@chromium.org>
Date: Mon Aug 28 08:56:03 2017

Worklet: Load module scripts on the main thread

This is a preparation CL for supporting module script loading for threaded
worklets. This CL moves codes to fetch module scripts for worklets from the
worklet context thread to the main thread.

<Reason of this change>

This change has some pros and cons as follows:

Pros:
1) This enables to support module script loading for threaded worklets without
   off-main-thread-fetch for ScriptResource. The off-main-thread-fetch for
   RawResource will be supported soon but we don't have any plans to support
   the off-main-thread-fetch for ScriptResource yet.
2) This enables to utilize the memory cache. The off-main-thread-fetch doesn't
   go through the memory cache because the cache is tied with the main thread.

Cons:
3) We're now actively migrating things to off-main-thread to avoid contentions
   on the main thread, but this is a retrograde change.

The primary reason is 1). This change enables to support module script loading
for threaded worklets and also unblocks supporting it for workers with less
effort. IMHO, implementing the off-main-thread-fetch for ScriptResource seems to
need more time and effort, so it would be a good call to implement module
loading without it to accomodate the needs of module loading as soon as
possible.

<Summary of this change>

This CL makes WorkletModuleResponsesMap fetch module scripts via
ModuleScriptFetcher on the main thread instead of WorkletModuleScriptFetcher on
the worklet context thread. This change needs to pass FetchParameters among the
threads, so this CL introduces CrossThreadFetchParametersData.

This CL doesn't enable module script loading for threaded worklets yet. It'll be
enabled by a following CL:
https://chromium-review.googlesource.com/c/chromium/src/+/627543

Bug:  727194 
Change-Id: I5fb2e7a1f05de34c616855e63dd5e7adf2a8d49e
Reviewed-on: https://chromium-review.googlesource.com/623044
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#497718}
[modify] https://crrev.com/890685b158cc617d78039205988dc3ac04c2e29d/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptFetcher.cpp
[modify] https://crrev.com/890685b158cc617d78039205988dc3ac04c2e29d/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptFetcher.h
[modify] https://crrev.com/890685b158cc617d78039205988dc3ac04c2e29d/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoader.cpp
[modify] https://crrev.com/890685b158cc617d78039205988dc3ac04c2e29d/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoader.h
[modify] https://crrev.com/890685b158cc617d78039205988dc3ac04c2e29d/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderTest.cpp
[modify] https://crrev.com/890685b158cc617d78039205988dc3ac04c2e29d/third_party/WebKit/Source/core/loader/modulescript/WorkletModuleScriptFetcher.cpp
[modify] https://crrev.com/890685b158cc617d78039205988dc3ac04c2e29d/third_party/WebKit/Source/core/loader/modulescript/WorkletModuleScriptFetcher.h
[modify] https://crrev.com/890685b158cc617d78039205988dc3ac04c2e29d/third_party/WebKit/Source/core/workers/Worklet.cpp
[modify] https://crrev.com/890685b158cc617d78039205988dc3ac04c2e29d/third_party/WebKit/Source/core/workers/WorkletModuleResponsesMap.cpp
[modify] https://crrev.com/890685b158cc617d78039205988dc3ac04c2e29d/third_party/WebKit/Source/core/workers/WorkletModuleResponsesMap.h
[modify] https://crrev.com/890685b158cc617d78039205988dc3ac04c2e29d/third_party/WebKit/Source/core/workers/WorkletModuleResponsesMapProxy.cpp
[modify] https://crrev.com/890685b158cc617d78039205988dc3ac04c2e29d/third_party/WebKit/Source/core/workers/WorkletModuleResponsesMapProxy.h
[modify] https://crrev.com/890685b158cc617d78039205988dc3ac04c2e29d/third_party/WebKit/Source/core/workers/WorkletModuleResponsesMapTest.cpp
[modify] https://crrev.com/890685b158cc617d78039205988dc3ac04c2e29d/third_party/WebKit/Source/platform/loader/fetch/FetchInitiatorInfo.h
[modify] https://crrev.com/890685b158cc617d78039205988dc3ac04c2e29d/third_party/WebKit/Source/platform/loader/fetch/FetchParameters.cpp
[modify] https://crrev.com/890685b158cc617d78039205988dc3ac04c2e29d/third_party/WebKit/Source/platform/loader/fetch/FetchParameters.h

Project Member

Comment 10 by bugdroid1@chromium.org, Aug 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/07dcc9e4f690dab4b67e2debc253ccefe11621df

commit 07dcc9e4f690dab4b67e2debc253ccefe11621df
Author: Hiroki Nakagawa <nhiroki@chromium.org>
Date: Mon Aug 28 14:42:55 2017

Worklet: Unify WorkerReportingProxy handling among workers and worklets

In the current implementation, WorkerReportingProxy is available only for
workers and threaded worklets. On the other hand, module loading for worklets is
implemented as a thread-agnostic way. These make it difficult to unify code
paths among main thread worklets and threaded worklets. For example, if we want
to call WorkerReportingProxy::DidEvaluateWorkerScript() after module script
evaluation, we need special cares for main thread worklets because they don't
have the reporting proxy.

This CL introduces WorkerReportingProxy for main thread worklets and unify the
proxy handling among them.

To be specific, this CL...

- introduces MainThreadWorkerReportingProxy for main thread worklets,
- moves UseCounter handling in derivatives of WorkerOrWorkletGlobalScope into
  WorkerOrWorkletGlobalScope, and
- makes WorkerOrWorkletGlobalScope own a reference to WorkerReportingProxy so
  that it doesn't have to depend on WorkerThread to take the reporting proxy and
  it enables to share codes among main thread worklets and others (main thread
  worklets don't have an instance of WorkerThread).

Bug:  727194 
Change-Id: If661cd85c5ce7ce09f2825d69c315a06a3ca98f6
Reviewed-on: https://chromium-review.googlesource.com/637054
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Xida Chen <xidachen@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#497757}
[modify] https://crrev.com/07dcc9e4f690dab4b67e2debc253ccefe11621df/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderTest.cpp
[modify] https://crrev.com/07dcc9e4f690dab4b67e2debc253ccefe11621df/third_party/WebKit/Source/core/workers/BUILD.gn
[modify] https://crrev.com/07dcc9e4f690dab4b67e2debc253ccefe11621df/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp
[modify] https://crrev.com/07dcc9e4f690dab4b67e2debc253ccefe11621df/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h
[add] https://crrev.com/07dcc9e4f690dab4b67e2debc253ccefe11621df/third_party/WebKit/Source/core/workers/MainThreadWorkletReportingProxy.cpp
[add] https://crrev.com/07dcc9e4f690dab4b67e2debc253ccefe11621df/third_party/WebKit/Source/core/workers/MainThreadWorkletReportingProxy.h
[modify] https://crrev.com/07dcc9e4f690dab4b67e2debc253ccefe11621df/third_party/WebKit/Source/core/workers/MainThreadWorkletTest.cpp
[modify] https://crrev.com/07dcc9e4f690dab4b67e2debc253ccefe11621df/third_party/WebKit/Source/core/workers/ThreadedWorkletGlobalScope.cpp
[modify] https://crrev.com/07dcc9e4f690dab4b67e2debc253ccefe11621df/third_party/WebKit/Source/core/workers/ThreadedWorkletGlobalScope.h
[modify] https://crrev.com/07dcc9e4f690dab4b67e2debc253ccefe11621df/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
[modify] https://crrev.com/07dcc9e4f690dab4b67e2debc253ccefe11621df/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h
[modify] https://crrev.com/07dcc9e4f690dab4b67e2debc253ccefe11621df/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp
[modify] https://crrev.com/07dcc9e4f690dab4b67e2debc253ccefe11621df/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h
[modify] https://crrev.com/07dcc9e4f690dab4b67e2debc253ccefe11621df/third_party/WebKit/Source/core/workers/WorkerReportingProxy.h
[modify] https://crrev.com/07dcc9e4f690dab4b67e2debc253ccefe11621df/third_party/WebKit/Source/core/workers/WorkletGlobalScope.cpp
[modify] https://crrev.com/07dcc9e4f690dab4b67e2debc253ccefe11621df/third_party/WebKit/Source/core/workers/WorkletGlobalScope.h
[modify] https://crrev.com/07dcc9e4f690dab4b67e2debc253ccefe11621df/third_party/WebKit/Source/core/workers/WorkletModuleTreeClient.cpp
[modify] https://crrev.com/07dcc9e4f690dab4b67e2debc253ccefe11621df/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp
[modify] https://crrev.com/07dcc9e4f690dab4b67e2debc253ccefe11621df/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h
[modify] https://crrev.com/07dcc9e4f690dab4b67e2debc253ccefe11621df/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.cpp
[modify] https://crrev.com/07dcc9e4f690dab4b67e2debc253ccefe11621df/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.h

Project Member

Comment 11 by bugdroid1@chromium.org, Aug 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b5ac9d93b178a72e729ae643ad14181201427d75

commit b5ac9d93b178a72e729ae643ad14181201427d75
Author: Hiroki Nakagawa <nhiroki@chromium.org>
Date: Tue Aug 29 17:02:18 2017

Worklet: Add WorkerReportingProxy::DidEvaluateModuleScript()

This is a preparation CL for module loading support on threaded worklets.

This CL introduces WorkerReportingProxy::DidEvaluateModuleScript(). This is
expected to be used for recording script evaluation results in UMA or as a hook
point.

For now, AudioWorklet uses this as a hook point. Before this CL,
AudioWorkletObjectProxy overrides ThreadedWorkletObjectProxy::EvaluateScript()
to synchronize some data after script evaluation. However, this function is used
for classic script loading and will be removed in favor of module script
loading. After this CL, AudioWorkletObjectProxy overrides
DidEvaluateModuleScript() instead and it's ready to remove EvaluateScript() in a
subsequent CL.

Bug:  727194 
Change-Id: I7ab9559b25839f0b54c4f6e4cc3b7bed39c82e75
Reviewed-on: https://chromium-review.googlesource.com/637292
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Hongchan Choi <hongchan@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#498144}
[modify] https://crrev.com/b5ac9d93b178a72e729ae643ad14181201427d75/third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.h
[modify] https://crrev.com/b5ac9d93b178a72e729ae643ad14181201427d75/third_party/WebKit/Source/core/workers/WorkerReportingProxy.h
[modify] https://crrev.com/b5ac9d93b178a72e729ae643ad14181201427d75/third_party/WebKit/Source/core/workers/WorkletGlobalScope.cpp
[modify] https://crrev.com/b5ac9d93b178a72e729ae643ad14181201427d75/third_party/WebKit/Source/core/workers/WorkletModuleTreeClient.cpp
[modify] https://crrev.com/b5ac9d93b178a72e729ae643ad14181201427d75/third_party/WebKit/Source/modules/webaudio/AudioWorkletObjectProxy.cpp
[modify] https://crrev.com/b5ac9d93b178a72e729ae643ad14181201427d75/third_party/WebKit/Source/modules/webaudio/AudioWorkletObjectProxy.h

Project Member

Comment 12 by bugdroid1@chromium.org, Sep 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d22d2df8014490b385e2bc2700a11a0bf3201146

commit d22d2df8014490b385e2bc2700a11a0bf3201146
Author: Hiroki Nakagawa <nhiroki@chromium.org>
Date: Tue Sep 05 12:49:19 2017

ES6 Modules: Change ModuleScriptFetcher to an abstract class

For cleanup, this CL changes ModuleScriptFetcher to an abstract class, and
makes {Document,Worklet}ModuleScriptFetcher directly inherit it.

Before this CL, ModuleScriptFetcher is a concrete class used for module loading
on the Document context, and WorkletModuleScriptFetcher inherits
ModuleScriptFetcher for the Worklet context. This worked well until [1] because
WorkeltModuleScriptFetcher depended on functions of ModuleScriptFetcher (e.g.,
implementation of ResourceOwner). However, after the change,
WorkletModuleScriptFetcher no longer depends on them and doesn't have to
inherit it.

To simplify the code, this CL...
- changes ModuleScriptFetcher to an abstract class.
- introduces DocumentModuleScriptFetcher as implementation of
  ModuleScriptFetcher for the Document context. This is the same as the previous
  ModuleScriptFetcher.
- makes WorkletModuleScriptFetcher directly inherit ModuleScriptFetcher as
  opposed to DocumentModuleScriptFetcher.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/623044

Bug:  727194 
Change-Id: I42631f5c21d8473b9a121883b4a5b027c56089cd
Reviewed-on: https://chromium-review.googlesource.com/641297
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499612}
[modify] https://crrev.com/d22d2df8014490b385e2bc2700a11a0bf3201146/third_party/WebKit/Source/core/loader/BUILD.gn
[add] https://crrev.com/d22d2df8014490b385e2bc2700a11a0bf3201146/third_party/WebKit/Source/core/loader/modulescript/DocumentModuleScriptFetcher.cpp
[add] https://crrev.com/d22d2df8014490b385e2bc2700a11a0bf3201146/third_party/WebKit/Source/core/loader/modulescript/DocumentModuleScriptFetcher.h
[modify] https://crrev.com/d22d2df8014490b385e2bc2700a11a0bf3201146/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptFetcher.cpp
[modify] https://crrev.com/d22d2df8014490b385e2bc2700a11a0bf3201146/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptFetcher.h
[modify] https://crrev.com/d22d2df8014490b385e2bc2700a11a0bf3201146/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoader.cpp
[modify] https://crrev.com/d22d2df8014490b385e2bc2700a11a0bf3201146/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoader.h
[modify] https://crrev.com/d22d2df8014490b385e2bc2700a11a0bf3201146/third_party/WebKit/Source/core/loader/modulescript/WorkletModuleScriptFetcher.cpp
[modify] https://crrev.com/d22d2df8014490b385e2bc2700a11a0bf3201146/third_party/WebKit/Source/core/loader/modulescript/WorkletModuleScriptFetcher.h
[modify] https://crrev.com/d22d2df8014490b385e2bc2700a11a0bf3201146/third_party/WebKit/Source/core/workers/WorkletModuleResponsesMap.cpp
[modify] https://crrev.com/d22d2df8014490b385e2bc2700a11a0bf3201146/third_party/WebKit/Source/core/workers/WorkletModuleResponsesMap.h
[modify] https://crrev.com/d22d2df8014490b385e2bc2700a11a0bf3201146/third_party/WebKit/Source/core/workers/WorkletModuleResponsesMapProxy.cpp
[modify] https://crrev.com/d22d2df8014490b385e2bc2700a11a0bf3201146/third_party/WebKit/Source/core/workers/WorkletModuleResponsesMapTest.cpp
[modify] https://crrev.com/d22d2df8014490b385e2bc2700a11a0bf3201146/third_party/WebKit/Source/platform/loader/fetch/FetchParameters.h

Project Member

Comment 13 by bugdroid1@chromium.org, Sep 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/833643ec34fecee06fc6140db2da82226ca4209a

commit 833643ec34fecee06fc6140db2da82226ca4209a
Author: Hiroki Nakagawa <nhiroki@chromium.org>
Date: Wed Sep 06 08:51:21 2017

ES6 Modules: Introduce Document/WorkletModulatorImpl

This CL re-organizes the inheritance hierarchy of Modulator as follows:

  Before this CL
    - Modulator
      - ModulatorImpl
      - DummyModulator

  After this CL
    - Modulator
      - ModulatorImplBase
        - DocumentModulatorImpl
        - WorkletModulatorImpl
      - DummyModulator

Motivation of this change is to exclude execution-context-dependent things from
the common implementation using polymorphic types.

For an example of the execution-context-dependent things, Document context needs
DocumentModuleScriptFetcher for module loading, while Worklet context needs
WorkletModuleScriptFetcher. Before this CL, ModuleScriptLoader checks the type
of the execution context and creates an appropriate fetcher. After this CL,
Modulator internally handles it and other classes no longer take care of it.

Bug:  727194 
Change-Id: I91a114de4d39fc1a259397183b2fd3f3d7cafc2f
Reviewed-on: https://chromium-review.googlesource.com/651452
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499907}
[modify] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/dom/BUILD.gn
[add] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/dom/DocumentModulatorImpl.cpp
[add] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/dom/DocumentModulatorImpl.h
[modify] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/dom/Modulator.cpp
[modify] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/dom/Modulator.h
[rename] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/dom/ModulatorImplBase.cpp
[rename] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/dom/ModulatorImplBase.h
[modify] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/dom/ModuleScript.h
[add] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/dom/WorkletModulatorImpl.cpp
[add] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/dom/WorkletModulatorImpl.h
[modify] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/loader/modulescript/DocumentModuleScriptFetcher.cpp
[modify] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/loader/modulescript/DocumentModuleScriptFetcher.h
[modify] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptFetcher.cpp
[modify] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptFetcher.h
[modify] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoader.cpp
[modify] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoader.h
[modify] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderRegistry.cpp
[modify] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderRegistry.h
[modify] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderTest.cpp
[modify] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/loader/modulescript/WorkletModuleScriptFetcher.cpp
[modify] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/loader/modulescript/WorkletModuleScriptFetcher.h
[modify] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/testing/DummyModulator.cpp
[modify] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/testing/DummyModulator.h
[modify] https://crrev.com/833643ec34fecee06fc6140db2da82226ca4209a/third_party/WebKit/Source/core/workers/WorkletModuleResponsesMap.cpp

Project Member

Comment 14 by bugdroid1@chromium.org, Sep 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2bbd38b24eb1c5e023323e0f78cce70474d78629

commit 2bbd38b24eb1c5e023323e0f78cce70474d78629
Author: Hiroki Nakagawa <nhiroki@chromium.org>
Date: Thu Sep 07 03:24:54 2017

Worklet: Enable module script loading for threaded worklets

This CL finally enables module script loading for threaded worklets (Animation
Worklet and Audio Worklet) and removes classic script loading used as a stopgap.

In addition, this moves animation-worklet-import.html from
virtual/threaded/http/tests/worklet/ to http/tests/worklet/ because module
loading requires a http server but tests under
virtual/threaded/http/tests/worklet don't run on it.

Bug:  727194 
Change-Id: Id79330b4331a6e628f839c84501064b80e3f5138
Reviewed-on: https://chromium-review.googlesource.com/627543
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#500207}
[add] https://crrev.com/2bbd38b24eb1c5e023323e0f78cce70474d78629/third_party/WebKit/LayoutTests/http/tests/worklet/animation-worklet-import.html
[delete] https://crrev.com/94b37d283b45036a471e316ffcaf8fe71914a7ac/third_party/WebKit/LayoutTests/virtual/threaded/http/tests/worklet/animation-worklet-import.html
[modify] https://crrev.com/2bbd38b24eb1c5e023323e0f78cce70474d78629/third_party/WebKit/Source/core/dom/Modulator.cpp
[modify] https://crrev.com/2bbd38b24eb1c5e023323e0f78cce70474d78629/third_party/WebKit/Source/core/workers/ThreadedWorkletMessagingProxy.cpp
[modify] https://crrev.com/2bbd38b24eb1c5e023323e0f78cce70474d78629/third_party/WebKit/Source/core/workers/ThreadedWorkletMessagingProxy.h
[modify] https://crrev.com/2bbd38b24eb1c5e023323e0f78cce70474d78629/third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.cpp
[modify] https://crrev.com/2bbd38b24eb1c5e023323e0f78cce70474d78629/third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.h
[modify] https://crrev.com/2bbd38b24eb1c5e023323e0f78cce70474d78629/third_party/WebKit/Source/core/workers/WorkerThread.cpp
[modify] https://crrev.com/2bbd38b24eb1c5e023323e0f78cce70474d78629/third_party/WebKit/Source/core/workers/WorkletGlobalScope.cpp

Labels: M-63
Status: Fixed (was: Started)
Fixed \o/

Sign in to add a comment