OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef Modulator_h | 5 #ifndef Modulator_h |
6 #define Modulator_h | 6 #define Modulator_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "bindings/core/v8/V8PerContextData.h" | 9 #include "bindings/core/v8/V8PerContextData.h" |
10 #include "core/CoreExport.h" | 10 #include "core/CoreExport.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 class WebTaskRunner; | 27 class WebTaskRunner; |
28 | 28 |
29 // A SingleModuleClient is notified when single module script node (node as in a | 29 // A SingleModuleClient is notified when single module script node (node as in a |
30 // module tree graph) load is complete and its corresponding entry is created in | 30 // module tree graph) load is complete and its corresponding entry is created in |
31 // module map. | 31 // module map. |
32 class SingleModuleClient : public GarbageCollectedMixin { | 32 class SingleModuleClient : public GarbageCollectedMixin { |
33 public: | 33 public: |
34 virtual void NotifyModuleLoadFinished(ModuleScript*) = 0; | 34 virtual void NotifyModuleLoadFinished(ModuleScript*) = 0; |
35 }; | 35 }; |
36 | 36 |
37 // A ModuleTreeClient is notified when a module script and its whole descendent | |
38 // tree load is complete. | |
39 class ModuleTreeClient : public GarbageCollectedMixin { | |
40 public: | |
41 virtual void NotifyModuleTreeLoadFinished(ModuleScript*) = 0; | |
42 }; | |
43 | |
44 // spec: "top-level module fetch flag" | 37 // spec: "top-level module fetch flag" |
45 // https://html.spec.whatwg.org/multipage/webappapis.html#fetching-scripts-is-to
p-level | 38 // https://html.spec.whatwg.org/multipage/webappapis.html#fetching-scripts-is-to
p-level |
46 enum class ModuleGraphLevel { kTopLevelModuleFetch, kDependentModuleFetch }; | 39 enum class ModuleGraphLevel { kTopLevelModuleFetch, kDependentModuleFetch }; |
47 | 40 |
48 // A Modulator is an interface for "environment settings object" concept for | 41 // A Modulator is an interface for "environment settings object" concept for |
49 // module scripts. | 42 // module scripts. |
50 // https://html.spec.whatwg.org/#environment-settings-object | 43 // https://html.spec.whatwg.org/#environment-settings-object |
51 // | 44 // |
52 // A Modulator also serves as an entry point for various module spec algorithms. | 45 // A Modulator also serves as an entry point for various module spec algorithms. |
53 class CORE_EXPORT Modulator : public GarbageCollectedFinalized<Modulator>, | 46 class CORE_EXPORT Modulator : public GarbageCollectedFinalized<Modulator>, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // if the cached entry doesn't exist. | 88 // if the cached entry doesn't exist. |
96 // The client can be notified either synchronously or asynchronously. | 89 // The client can be notified either synchronously or asynchronously. |
97 virtual void FetchNewSingleModule(const ModuleScriptFetchRequest&, | 90 virtual void FetchNewSingleModule(const ModuleScriptFetchRequest&, |
98 ModuleGraphLevel, | 91 ModuleGraphLevel, |
99 ModuleScriptLoaderClient*) = 0; | 92 ModuleScriptLoaderClient*) = 0; |
100 }; | 93 }; |
101 | 94 |
102 } // namespace blink | 95 } // namespace blink |
103 | 96 |
104 #endif | 97 #endif |
OLD | NEW |