Index: third_party/WebKit/Source/modules/worklet/Worklet.h |
diff --git a/third_party/WebKit/Source/modules/worklet/Worklet.h b/third_party/WebKit/Source/modules/worklet/Worklet.h |
index 5fda2978ac72ae3821c1fd23008edc176ec6c303..2523d28d3b9f36b6345a4c7b666ac365f5f16acc 100644 |
--- a/third_party/WebKit/Source/modules/worklet/Worklet.h |
+++ b/third_party/WebKit/Source/modules/worklet/Worklet.h |
@@ -19,29 +19,30 @@ class ExecutionContext; |
class ScriptPromiseResolver; |
class WorkerScriptLoader; |
-class Worklet final : public GarbageCollectedFinalized<Worklet>, public ScriptWrappable, public ActiveDOMObject { |
+class Worklet : public GarbageCollectedFinalized<Worklet>, public ScriptWrappable, public ActiveDOMObject { |
DEFINE_WRAPPERTYPEINFO(); |
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Worklet); |
WTF_MAKE_NONCOPYABLE(Worklet); |
public: |
- // The ExecutionContext argument is the parent document of the Worklet. The |
- // Worklet inherits the url and userAgent, from the document. |
- static Worklet* create(LocalFrame*, ExecutionContext*); |
+ virtual WorkletGlobalScope* workletGlobalScope() const = 0; |
+ // Worklet |
ScriptPromise import(ScriptState*, const String& url); |
// ActiveDOMObject |
void stop() final; |
- DECLARE_TRACE(); |
+ DECLARE_VIRTUAL_TRACE(); |
-private: |
- Worklet(LocalFrame*, ExecutionContext*); |
+protected: |
+ // The ExecutionContext argument is the parent document of the Worklet. The |
+ // Worklet inherits the url and userAgent from the document. |
+ explicit Worklet(ExecutionContext*); |
+private: |
void onResponse(); |
void onFinished(WorkerScriptLoader*, ScriptPromiseResolver*); |
- RefPtrWillBeMember<WorkletGlobalScope> m_workletGlobalScope; |
Vector<RefPtr<WorkerScriptLoader>> m_scriptLoaders; |
HeapVector<Member<ScriptPromiseResolver>> m_resolvers; |
}; |