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

Unified Diff: third_party/WebKit/Source/core/dom/ModulatorImpl.h

Issue 2555653002: [WIP Prototype] ES6 https://html.spec.whatwg.org/#fetch-a-single-module-script implementation (Closed)
Patch Set: rebased Created 3 years, 9 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/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..2149be21738053c23b05a1df9986e66b34f676fb
--- /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 "bindings/core/v8/ScriptModule.h"
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "bindings/core/v8/TraceWrapperMember.h"
+#include "bindings/core/v8/V8PerIsolateData.h"
+#include "core/dom/Modulator.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class Document;
+class ExecutionContext;
+class ModuleMap;
+class ModuleScriptLoaderRegistry;
+class ModuleTreeLinkerRegistry;
+class ResourceFetcher;
+class ScriptState;
+class WebTaskRunner;
+
+class ModulatorImpl final : public Modulator {
+ public:
+ static ModulatorImpl* create(RefPtr<ScriptState>, Document&);
+
+ virtual ~ModulatorImpl();
+ DECLARE_TRACE();
+ DECLARE_VIRTUAL_TRACE_WRAPPERS();
+
+ private:
+ // Implements Modulator
+
+ ScriptModuleResolver* scriptModuleResolver() override {
+ return m_scriptModuleResolver.get();
+ }
+ ExecutionContext* executionContext() override {
+ return m_executionContext.get();
+ }
+ WebTaskRunner* taskRunner() override { return m_taskRunner.get(); }
+ ReferrerPolicy referrerPolicy() override;
+ SecurityOrigin* securityOrigin() override;
+
+ void fetchTree(const ModuleScriptFetchRequest&, ModuleTreeClient*) override;
+ void fetchTreeInternal(const ModuleScriptFetchRequest&,
+ const AncestorList&,
+ ModuleGraphLevel,
+ ModuleTreeClient*) override;
+ void fetchSingle(const ModuleScriptFetchRequest&,
+ ModuleGraphLevel,
+ SingleModuleClient*) override;
+ void fetchNewSingleModule(const ModuleScriptFetchRequest&,
+ ModuleGraphLevel,
+ ModuleScriptLoaderClient*) override;
+ ModuleScript* getFetchedModuleScript(const KURL&) override;
+ ScriptModule compileModule(const String& script,
+ const String& urlStr) override;
+ ScriptValue instantiateModule(ScriptModule) override;
+ Vector<String> moduleRequestsFromScriptModule(ScriptModule) override;
+ void executeModule(ScriptModule) override;
+
+ private:
+ ModulatorImpl(RefPtr<ScriptState>,
+ RefPtr<WebTaskRunner>,
+ ExecutionContext*,
+ ResourceFetcher*);
+
+ RefPtr<ScriptState> m_scriptState;
+ RefPtr<WebTaskRunner> m_taskRunner;
+ Member<ExecutionContext> m_executionContext;
+ Member<ResourceFetcher> m_fetcher;
+ TraceWrapperMember<ModuleMap> m_map;
+ Member<ModuleScriptLoaderRegistry> m_loaderRegistry;
+ Member<ModuleTreeLinkerRegistry> m_treeLinkerRegistry;
+ Member<ScriptModuleResolver> m_scriptModuleResolver;
+};
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698