Chromium Code Reviews| Index: third_party/WebKit/Source/core/workers/Worklet.h |
| diff --git a/third_party/WebKit/Source/core/workers/Worklet.h b/third_party/WebKit/Source/core/workers/Worklet.h |
| index 6d44e30f35ec4ee13538fe7897b701f07799c1ad..1d843e984f437b931f1014baccd2bae26502dc5a 100644 |
| --- a/third_party/WebKit/Source/core/workers/Worklet.h |
| +++ b/third_party/WebKit/Source/core/workers/Worklet.h |
| @@ -6,21 +6,21 @@ |
| #define Worklet_h |
| #include "bindings/core/v8/ScriptPromise.h" |
| -#include "bindings/core/v8/ScriptPromiseResolver.h" |
| #include "bindings/core/v8/ScriptWrappable.h" |
| #include "core/CoreExport.h" |
| #include "core/dom/ContextLifecycleObserver.h" |
| -#include "core/loader/WorkletScriptLoader.h" |
| #include "platform/heap/Handle.h" |
| -#include "platform/loader/fetch/ResourceFetcher.h" |
| namespace blink { |
| class LocalFrame; |
| class WorkletGlobalScopeProxy; |
| +// This is the base implementation of Worklet interface defined in the spec: |
| +// https://drafts.css-houdini.org/worklets/#worklet |
| +// Regardless of worklet types, this must be created and destroyed on the main |
|
falken
2017/04/18 03:37:53
"Although some worklets run off the main thread, t
nhiroki
2017/04/18 04:05:20
Done.
|
| +// thread. |
| class CORE_EXPORT Worklet : public GarbageCollectedFinalized<Worklet>, |
| - public WorkletScriptLoader::Client, |
| public ScriptWrappable, |
| public ContextLifecycleObserver { |
| DEFINE_WRAPPERTYPEINFO(); |
| @@ -33,17 +33,14 @@ class CORE_EXPORT Worklet : public GarbageCollectedFinalized<Worklet>, |
| virtual void Initialize() {} |
| virtual bool IsInitialized() const { return true; } |
| - virtual WorkletGlobalScopeProxy* GetWorkletGlobalScopeProxy() const = 0; |
| - |
| - // Worklet |
| - ScriptPromise import(ScriptState*, const String& url); |
| + // https://drafts.css-houdini.org/worklets/#dom-worklet-import |
|
falken
2017/04/18 03:37:53
nit: Ah, I see. Maybe this should additionally say
nhiroki
2017/04/18 04:05:20
I see. The original code has "// Worklet" but I th
|
| + virtual ScriptPromise import(ScriptState*, const String& url) = 0; |
| - // WorkletScriptLoader::Client |
| - void NotifyWorkletScriptLoadingFinished(WorkletScriptLoader*, |
| - const ScriptSourceCode&) final; |
| + // Returns a proxy to WorkletGlobalScope on the context thread. |
| + virtual WorkletGlobalScopeProxy* GetWorkletGlobalScopeProxy() const = 0; |
| // ContextLifecycleObserver |
| - void ContextDestroyed(ExecutionContext*) final; |
| + virtual void ContextDestroyed(ExecutionContext*); |
| DECLARE_VIRTUAL_TRACE(); |
| @@ -51,10 +48,7 @@ class CORE_EXPORT Worklet : public GarbageCollectedFinalized<Worklet>, |
| // The Worklet inherits the url and userAgent from the frame->document(). |
| explicit Worklet(LocalFrame*); |
| - private: |
| Member<LocalFrame> frame_; |
| - HeapHashMap<Member<WorkletScriptLoader>, Member<ScriptPromiseResolver>> |
| - loader_and_resolvers_; |
| }; |
| } // namespace blink |