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

Side by Side Diff: third_party/WebKit/Source/core/dom/ModulatorImpl.h

Issue 2826803004: [ES6 modules] Introduce ModulatorImpl (Closed)
Patch Set: classcommt Created 3 years, 8 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ModulatorImpl_h
6 #define ModulatorImpl_h
7
8 #include "bindings/core/v8/ScriptModule.h"
9 #include "bindings/core/v8/ScriptWrappable.h"
10 #include "bindings/core/v8/TraceWrapperMember.h"
11 #include "bindings/core/v8/V8PerIsolateData.h"
12 #include "core/dom/Modulator.h"
13 #include "platform/heap/Handle.h"
14
15 namespace blink {
16
17 class Document;
18 class ExecutionContext;
19 class ModuleMap;
20 class ModuleScriptLoaderRegistry;
21 class ResourceFetcher;
22 class ScriptState;
23 class WebTaskRunner;
24
25 // ModulatorImpl is the implementation of Modulator interface, which represents
26 // "environment settings object" concept for module scripts.
27 // ModulatorImpl serves as the backplane for tieing all ES6 module algorithm
28 // components together.
29 class ModulatorImpl final : public Modulator {
30 public:
31 static ModulatorImpl* Create(RefPtr<ScriptState>, Document&);
32
33 virtual ~ModulatorImpl();
34 DECLARE_TRACE();
35 DECLARE_VIRTUAL_TRACE_WRAPPERS();
36
37 private:
38 // Implements Modulator
39
40 ScriptModuleResolver* GetScriptModuleResolver() override {
41 return script_module_resolver_.Get();
42 }
43 WebTaskRunner* TaskRunner() override { return task_runner_.Get(); }
44 ReferrerPolicy GetReferrerPolicy() override;
45 SecurityOrigin* GetSecurityOrigin() override;
46
47 void FetchTree(const ModuleScriptFetchRequest&, ModuleTreeClient*) override;
48 void FetchTreeInternal(const ModuleScriptFetchRequest&,
49 const AncestorList&,
50 ModuleGraphLevel,
51 ModuleTreeClient*) override;
52 void FetchSingle(const ModuleScriptFetchRequest&,
53 ModuleGraphLevel,
54 SingleModuleClient*) override;
55 ModuleScript* GetFetchedModuleScript(const KURL&) override;
56 void FetchNewSingleModule(const ModuleScriptFetchRequest&,
57 ModuleGraphLevel,
58 ModuleScriptLoaderClient*) override;
59 ScriptModule CompileModule(const String& script,
60 const String& url_str,
61 AccessControlStatus) override;
62 ScriptValue InstantiateModule(ScriptModule) override;
63 Vector<String> ModuleRequestsFromScriptModule(ScriptModule) override;
64
65 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.
66 ModulatorImpl(RefPtr<ScriptState>,
67 RefPtr<WebTaskRunner>,
68 ExecutionContext*,
69 ResourceFetcher*);
70
71 RefPtr<ScriptState> script_state_;
72 RefPtr<WebTaskRunner> task_runner_;
73 Member<ExecutionContext> execution_context_;
74 Member<ResourceFetcher> fetcher_;
75 TraceWrapperMember<ModuleMap> map_;
76 Member<ModuleScriptLoaderRegistry> loader_registry_;
77 Member<ScriptModuleResolver> script_module_resolver_;
78 };
79
80 } // namespace blink
81
82 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698