Index: third_party/WebKit/Source/core/dom/ModulatorImpl.h |
diff --git a/third_party/WebKit/Source/core/dom/ModulatorImpl.h b/third_party/WebKit/Source/core/dom/ModulatorImpl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a3683bdb7fdbb2796fa9a0ad75d61ad4d27fd9fd |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/dom/ModulatorImpl.h |
@@ -0,0 +1,83 @@ |
+// Copyright 2017 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 ModulatorImpl_h |
+#define ModulatorImpl_h |
+ |
+#include "core/dom/Modulator.h" |
+#include "platform/heap/Handle.h" |
+ |
+namespace blink { |
+ |
+class ExecutionContext; |
+class ModuleController; |
+class ModuleMap; |
+class ModuleScriptLoaderRegistry; |
+class ModuleTreeLinkerRegistry; |
+class ResourceFetcher; |
+class ScriptModuleResolverImpl; |
+class WebTaskRunner; |
+ |
+class ModulatorImpl final : public GarbageCollectedFinalized<Modulator>, |
+ public Modulator { |
+ USING_GARBAGE_COLLECTED_MIXIN(ModulatorImpl); |
+ |
+ public: |
+ static ModulatorImpl* create(ExecutionContext* executionContext, |
+ ModuleController* controller, |
+ ResourceFetcher* fetcher) { |
+ return new ModulatorImpl(executionContext, controller, fetcher); |
+ } |
+ virtual ~ModulatorImpl(); |
+ DECLARE_TRACE(); |
+ |
+ private: |
+ // Implements Modulator |
+ |
+ ModuleController* moduleController() override { |
+ return m_moduleController.get(); |
+ } |
+ ScriptModuleResolver* scriptModuleResolver() override; |
+ WebTaskRunner* taskRunner() override; |
+ |
+ // https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-module-script-tree |
+ void fetchTree(const KURL&, const KURL& baseURL, ModuleTreeClient*) override; |
+ |
+ // for internal use by this specification only as part of fetching a module |
+ // script graph or preparing a script, and should not be used directly by |
+ // other specifications." |
+ void fetchSingle( |
+ const KURL&, |
+ const KURL& baseURL, |
+ SingleModuleClient* |
+ /*, a fetch client settings object, a destination, a cryptographic nonce, a parser state, a credentials mode, a module map settings object, a referrer, and a top-level module fetch flag*/) |
+ override; |
+ |
+ void fetchNewSingleModule( |
+ const KURL&, |
+ const KURL& baseURL, |
+ ModuleScriptLoaderClient* |
+ /*, a fetch client settings object, a destination, a cryptographic nonce, a parser state, a credentials mode, a module map settings object, a referrer, and a top-level module fetch flag*/) |
+ override; |
+ |
+ ModuleScript* retrieveFetchedModuleScript(const KURL&) override; |
+ |
+ private: |
+ ModulatorImpl(ExecutionContext*, ModuleController*, ResourceFetcher*); |
+ |
+ // https://html.spec.whatwg.org/multipage/webappapis.html#internal-module-script-graph-fetching-procedure |
+ void fetchTreeInternal(const KURL&, const KURL& baseURL, ModuleTreeClient*); |
+ |
+ Member<ModuleMap> m_map; |
+ Member<ExecutionContext> m_executionContext; |
+ Member<ModuleController> m_moduleController; |
+ Member<ResourceFetcher> m_fetcher; |
+ Member<ModuleScriptLoaderRegistry> m_loaderRegistry; |
+ Member<ModuleTreeLinkerRegistry> m_treeLinkerRegistry; |
+ Member<ScriptModuleResolverImpl> m_scriptModuleResolver; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif |