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

Side by Side 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: ModuleScriptLoaderTest Created 3 years, 11 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 "core/dom/Modulator.h"
9 #include "platform/heap/Handle.h"
10
11 namespace blink {
12
13 class ExecutionContext;
14 class ModuleController;
15 class ModuleMap;
16 class ModuleScriptLoaderRegistry;
17 class ModuleTreeLinkerRegistry;
18 class ResourceFetcher;
19 class ScriptModuleResolverImpl;
20 class WebTaskRunner;
21
22 class ModulatorImpl final : public GarbageCollectedFinalized<Modulator>,
23 public Modulator {
24 USING_GARBAGE_COLLECTED_MIXIN(ModulatorImpl);
25
26 public:
27 static ModulatorImpl* create(ExecutionContext* executionContext,
28 ModuleController* controller,
29 ResourceFetcher* fetcher) {
30 return new ModulatorImpl(executionContext, controller, fetcher);
31 }
32 virtual ~ModulatorImpl();
33 DECLARE_TRACE();
34
35 private:
36 // Implements Modulator
37
38 ModuleController* moduleController() override {
39 return m_moduleController.get();
40 }
41 ScriptModuleResolver* scriptModuleResolver() override;
42 WebTaskRunner* taskRunner() override;
43
44 // https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-module-scrip t-tree
45 void fetchTree(const KURL&, const KURL& baseURL, ModuleTreeClient*) override;
46
47 // for internal use by this specification only as part of fetching a module
48 // script graph or preparing a script, and should not be used directly by
49 // other specifications."
50 void fetchSingle(
51 const KURL&,
52 const KURL& baseURL,
53 SingleModuleClient*
54 /*, a fetch client settings object, a destination, a cryptographic nonce, a parser state, a credentials mode, a module map settings object, a referrer, an d a top-level module fetch flag*/)
55 override;
56
57 void fetchNewSingleModule(
58 const KURL&,
59 const KURL& baseURL,
60 ModuleScriptLoaderClient*
61 /*, a fetch client settings object, a destination, a cryptographic nonce, a parser state, a credentials mode, a module map settings object, a referrer, an d a top-level module fetch flag*/)
62 override;
63
64 ModuleScript* retrieveFetchedModuleScript(const KURL&) override;
65
66 private:
67 ModulatorImpl(ExecutionContext*, ModuleController*, ResourceFetcher*);
68
69 // https://html.spec.whatwg.org/multipage/webappapis.html#internal-module-scri pt-graph-fetching-procedure
70 void fetchTreeInternal(const KURL&, const KURL& baseURL, ModuleTreeClient*);
71
72 Member<ModuleMap> m_map;
73 Member<ExecutionContext> m_executionContext;
74 Member<ModuleController> m_moduleController;
75 Member<ResourceFetcher> m_fetcher;
76 Member<ModuleScriptLoaderRegistry> m_loaderRegistry;
77 Member<ModuleTreeLinkerRegistry> m_treeLinkerRegistry;
78 Member<ScriptModuleResolverImpl> m_scriptModuleResolver;
79 };
80
81 } // namespace blink
82
83 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698