Index: third_party/WebKit/Source/modules/worklet/WorkletScriptLoader.h |
diff --git a/third_party/WebKit/Source/modules/worklet/WorkletScriptLoader.h b/third_party/WebKit/Source/modules/worklet/WorkletScriptLoader.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e05d69b6339e0814c2260f696b1cfea8d74b7518 |
--- /dev/null |
+++ b/third_party/WebKit/Source/modules/worklet/WorkletScriptLoader.h |
@@ -0,0 +1,43 @@ |
+#ifndef WorkletScriptLoader_h |
+#define WorkletScriptLoader_h |
+ |
+#include "bindings/core/v8/ScriptPromiseResolver.h" |
+#include "core/fetch/ResourceClient.h" |
+#include "core/fetch/ScriptResource.h" |
+ |
+namespace blink { |
+ |
+class ScriptPromiseResolver; |
+class Worklet; |
+class WorkletGlobalScopeProxy; |
+ |
+class WorkletScriptLoader final : public GarbageCollectedFinalized<WorkletScriptLoader>, public ScriptResourceClient { |
+ USING_GARBAGE_COLLECTED_MIXIN(WorkletScriptLoader); |
+public: |
+ static WorkletScriptLoader* create(ScriptPromiseResolver* scriptPromiseResolver, WorkletGlobalScopeProxy* workletGlobalScopeProxy, |
+ Worklet* worklet) |
+ { |
+ return new WorkletScriptLoader(scriptPromiseResolver, workletGlobalScopeProxy, worklet); |
+ } |
+ |
+ ~WorkletScriptLoader() override = default; |
+ |
+ DECLARE_TRACE(); |
+ |
+private: |
+ WorkletScriptLoader(ScriptPromiseResolver*, WorkletGlobalScopeProxy*, Worklet* host); |
+ |
+ // ResourceClient |
+ void notifyFinished(Resource*) override; |
+ String debugName() const override { return "WorkletLoader"; } |
+ |
+ Member<ScriptPromiseResolver> m_resolver; |
+ Member<Worklet> m_host; |
+ WorkletGlobalScopeProxy* m_workletGlobalScopeProxy; |
+ |
+ WTF_MAKE_NONCOPYABLE(WorkletScriptLoader); |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // WorkletScriptLoader_h |