| 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
|
|
|