Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(729)

Unified Diff: third_party/WebKit/Source/modules/worklet/WorkletScriptLoader.h

Issue 2178223002: Refactor Worklet class to use ScriptResource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: set m_fetcher in initialization list, s/override/final, copyright etc. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..198dd15f0c578f2567dc21c98d6fc35afd47a84e
--- /dev/null
+++ b/third_party/WebKit/Source/modules/worklet/WorkletScriptLoader.h
@@ -0,0 +1,47 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#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*) final;
+ String debugName() const final { return "WorkletLoader"; }
+
+ Member<ScriptPromiseResolver> m_resolver;
+ Member<Worklet> m_host;
+ WorkletGlobalScopeProxy* m_workletGlobalScopeProxy;
ikilpatrick 2016/07/28 22:42:10 I wouldn't store this here just access it through
Gleb Lanbin 2016/07/29 01:40:23 Done.
+
+ WTF_MAKE_NONCOPYABLE(WorkletScriptLoader);
ikilpatrick 2016/07/28 22:42:10 typically goes after USING_GAR...etc.
Gleb Lanbin 2016/07/29 01:40:23 Done.
+};
+
+} // namespace blink
+
+#endif // WorkletScriptLoader_h

Powered by Google App Engine
This is Rietveld 408576698