| 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" |
| 11 #include "core/dom/AncestorList.h" |
| 11 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
| 12 #include "platform/loader/fetch/AccessControlStatus.h" | 13 #include "platform/loader/fetch/AccessControlStatus.h" |
| 13 #include "platform/weborigin/KURL.h" | 14 #include "platform/weborigin/KURL.h" |
| 14 #include "platform/weborigin/ReferrerPolicy.h" | 15 #include "platform/weborigin/ReferrerPolicy.h" |
| 15 #include "platform/wtf/text/WTFString.h" | 16 #include "platform/wtf/text/WTFString.h" |
| 16 | 17 |
| 17 namespace blink { | 18 namespace blink { |
| 18 | 19 |
| 19 class ModuleScript; | 20 class ModuleScript; |
| 20 class ModuleScriptFetchRequest; | 21 class ModuleScriptFetchRequest; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 static void SetModulator(ScriptState*, Modulator*); | 63 static void SetModulator(ScriptState*, Modulator*); |
| 63 static void ClearModulator(ScriptState*); | 64 static void ClearModulator(ScriptState*); |
| 64 | 65 |
| 65 DEFINE_INLINE_VIRTUAL_TRACE() {} | 66 DEFINE_INLINE_VIRTUAL_TRACE() {} |
| 66 | 67 |
| 67 virtual ScriptModuleResolver* GetScriptModuleResolver() = 0; | 68 virtual ScriptModuleResolver* GetScriptModuleResolver() = 0; |
| 68 virtual WebTaskRunner* TaskRunner() = 0; | 69 virtual WebTaskRunner* TaskRunner() = 0; |
| 69 virtual ReferrerPolicy GetReferrerPolicy() = 0; | 70 virtual ReferrerPolicy GetReferrerPolicy() = 0; |
| 70 virtual SecurityOrigin* GetSecurityOrigin() = 0; | 71 virtual SecurityOrigin* GetSecurityOrigin() = 0; |
| 71 | 72 |
| 73 // https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-module-scrip
t-tree |
| 74 virtual void FetchTree(const ModuleScriptFetchRequest&, |
| 75 ModuleTreeClient*) = 0; |
| 76 |
| 77 // https://html.spec.whatwg.org/#internal-module-script-graph-fetching-procedu
re |
| 78 virtual void FetchTreeInternal(const ModuleScriptFetchRequest&, |
| 79 const AncestorList&, |
| 80 ModuleGraphLevel, |
| 81 ModuleTreeClient*) = 0; |
| 82 |
| 83 // Asynchronously retrieve a module script from the module map, or fetch it |
| 84 // and put it in the map if it's not there already. |
| 85 // https://html.spec.whatwg.org/#fetch-a-single-module-script |
| 86 virtual void FetchSingle(const ModuleScriptFetchRequest&, |
| 87 ModuleGraphLevel, |
| 88 SingleModuleClient*) = 0; |
| 89 |
| 72 // Synchronously retrieves a single module script from existing module map | 90 // Synchronously retrieves a single module script from existing module map |
| 73 // entry. | 91 // entry. |
| 74 virtual ModuleScript* GetFetchedModuleScript(const KURL&) = 0; | 92 virtual ModuleScript* GetFetchedModuleScript(const KURL&) = 0; |
| 75 | 93 |
| 76 // https://html.spec.whatwg.org/#resolve-a-module-specifier | 94 // https://html.spec.whatwg.org/#resolve-a-module-specifier |
| 77 static KURL ResolveModuleSpecifier(const String& module_request, | 95 static KURL ResolveModuleSpecifier(const String& module_request, |
| 78 const KURL& base_url); | 96 const KURL& base_url); |
| 79 | 97 |
| 80 virtual ScriptModule CompileModule(const String& script, | 98 virtual ScriptModule CompileModule(const String& script, |
| 81 const String& url_str, | 99 const String& url_str, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 95 // if the cached entry doesn't exist. | 113 // if the cached entry doesn't exist. |
| 96 // The client can be notified either synchronously or asynchronously. | 114 // The client can be notified either synchronously or asynchronously. |
| 97 virtual void FetchNewSingleModule(const ModuleScriptFetchRequest&, | 115 virtual void FetchNewSingleModule(const ModuleScriptFetchRequest&, |
| 98 ModuleGraphLevel, | 116 ModuleGraphLevel, |
| 99 ModuleScriptLoaderClient*) = 0; | 117 ModuleScriptLoaderClient*) = 0; |
| 100 }; | 118 }; |
| 101 | 119 |
| 102 } // namespace blink | 120 } // namespace blink |
| 103 | 121 |
| 104 #endif | 122 #endif |
| OLD | NEW |