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 "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
10 #include "platform/loader/fetch/AccessControlStatus.h" | 10 #include "platform/loader/fetch/AccessControlStatus.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 static Modulator* from(LocalFrame*); | 45 static Modulator* from(LocalFrame*); |
46 virtual ~Modulator(); | 46 virtual ~Modulator(); |
47 | 47 |
48 DEFINE_INLINE_VIRTUAL_TRACE() {} | 48 DEFINE_INLINE_VIRTUAL_TRACE() {} |
49 | 49 |
50 virtual ScriptModuleResolver* scriptModuleResolver() = 0; | 50 virtual ScriptModuleResolver* scriptModuleResolver() = 0; |
51 virtual WebTaskRunner* taskRunner() = 0; | 51 virtual WebTaskRunner* taskRunner() = 0; |
52 virtual ReferrerPolicy referrerPolicy() = 0; | 52 virtual ReferrerPolicy referrerPolicy() = 0; |
53 virtual SecurityOrigin* securityOrigin() = 0; | 53 virtual SecurityOrigin* securityOrigin() = 0; |
54 | 54 |
| 55 // Synchronously retrieves a single module script from existing module map |
| 56 // entry. |
| 57 virtual ModuleScript* getFetchedModuleScript(const KURL&) = 0; |
| 58 |
55 // https://html.spec.whatwg.org/#resolve-a-module-specifier | 59 // https://html.spec.whatwg.org/#resolve-a-module-specifier |
56 static KURL resolveModuleSpecifier(const String& moduleRequest, | 60 static KURL resolveModuleSpecifier(const String& moduleRequest, |
57 const KURL& baseURL); | 61 const KURL& baseURL); |
58 | 62 |
59 virtual ScriptModule compileModule(const String& script, | 63 virtual ScriptModule compileModule(const String& script, |
60 const String& urlStr, | 64 const String& urlStr, |
61 AccessControlStatus) = 0; | 65 AccessControlStatus) = 0; |
62 | 66 |
63 private: | 67 private: |
64 friend class ModuleMap; | 68 friend class ModuleMap; |
65 | 69 |
66 // Fetches a single module script. | 70 // Fetches a single module script. |
67 // This is triggered from fetchSingle() implementation (which is in ModuleMap) | 71 // This is triggered from fetchSingle() implementation (which is in ModuleMap) |
68 // if the cached entry doesn't exist. | 72 // if the cached entry doesn't exist. |
69 // The client can be notified either synchronously or asynchronously. | 73 // The client can be notified either synchronously or asynchronously. |
70 virtual void fetchNewSingleModule(const ModuleScriptFetchRequest&, | 74 virtual void fetchNewSingleModule(const ModuleScriptFetchRequest&, |
71 ModuleGraphLevel, | 75 ModuleGraphLevel, |
72 ModuleScriptLoaderClient*) = 0; | 76 ModuleScriptLoaderClient*) = 0; |
73 }; | 77 }; |
74 | 78 |
75 } // namespace blink | 79 } // namespace blink |
76 | 80 |
77 #endif | 81 #endif |
OLD | NEW |