Chromium Code Reviews| 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..e48709ac512038dda79cbe80bc711265d83c330d |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/dom/ModulatorImpl.h |
| @@ -0,0 +1,82 @@ |
| +// 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 ResourceFetcher; |
| +class ScriptState; |
| +class WebTaskRunner; |
| + |
| +// ModulatorImpl is the implementation of Modulator interface, which represents |
| +// "environment settings object" concept for module scripts. |
| +// ModulatorImpl serves as the backplane for tieing all ES6 module algorithm |
| +// components together. |
| +class ModulatorImpl final : public Modulator { |
| + public: |
| + static ModulatorImpl* Create(RefPtr<ScriptState>, Document&); |
| + |
| + virtual ~ModulatorImpl(); |
| + DECLARE_TRACE(); |
| + DECLARE_VIRTUAL_TRACE_WRAPPERS(); |
| + |
| + private: |
| + // Implements Modulator |
| + |
| + ScriptModuleResolver* GetScriptModuleResolver() override { |
| + return script_module_resolver_.Get(); |
| + } |
| + WebTaskRunner* TaskRunner() override { return task_runner_.Get(); } |
| + ReferrerPolicy GetReferrerPolicy() override; |
| + SecurityOrigin* GetSecurityOrigin() override; |
| + |
| + void FetchTree(const ModuleScriptFetchRequest&, ModuleTreeClient*) override; |
| + void FetchTreeInternal(const ModuleScriptFetchRequest&, |
| + const AncestorList&, |
| + ModuleGraphLevel, |
| + ModuleTreeClient*) override; |
| + void FetchSingle(const ModuleScriptFetchRequest&, |
| + ModuleGraphLevel, |
| + SingleModuleClient*) override; |
| + ModuleScript* GetFetchedModuleScript(const KURL&) override; |
| + void FetchNewSingleModule(const ModuleScriptFetchRequest&, |
| + ModuleGraphLevel, |
| + ModuleScriptLoaderClient*) override; |
| + ScriptModule CompileModule(const String& script, |
| + const String& url_str, |
| + AccessControlStatus) override; |
| + ScriptValue InstantiateModule(ScriptModule) override; |
| + Vector<String> ModuleRequestsFromScriptModule(ScriptModule) override; |
| + |
| + private: |
|
nhiroki
2017/04/19 03:15:47
We are already in a private section (see line 37)
kouhei (in TOK)
2017/04/19 03:38:53
Done.
|
| + ModulatorImpl(RefPtr<ScriptState>, |
| + RefPtr<WebTaskRunner>, |
| + ExecutionContext*, |
| + ResourceFetcher*); |
| + |
| + RefPtr<ScriptState> script_state_; |
| + RefPtr<WebTaskRunner> task_runner_; |
| + Member<ExecutionContext> execution_context_; |
| + Member<ResourceFetcher> fetcher_; |
| + TraceWrapperMember<ModuleMap> map_; |
| + Member<ModuleScriptLoaderRegistry> loader_registry_; |
| + Member<ScriptModuleResolver> script_module_resolver_; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif |