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/weborigin/KURL.h" | 11 #include "platform/weborigin/KURL.h" |
11 #include "platform/weborigin/ReferrerPolicy.h" | 12 #include "platform/weborigin/ReferrerPolicy.h" |
12 #include "wtf/text/WTFString.h" | 13 #include "wtf/text/WTFString.h" |
13 | 14 |
14 namespace blink { | 15 namespace blink { |
15 | 16 |
16 class LocalFrame; | 17 class LocalFrame; |
17 class ModuleScript; | 18 class ModuleScript; |
18 class ModuleScriptFetchRequest; | 19 class ModuleScriptFetchRequest; |
19 class ModuleScriptLoaderClient; | 20 class ModuleScriptLoaderClient; |
(...skipping 29 matching lines...) Expand all Loading... |
49 virtual ScriptModuleResolver* scriptModuleResolver() = 0; | 50 virtual ScriptModuleResolver* scriptModuleResolver() = 0; |
50 virtual WebTaskRunner* taskRunner() = 0; | 51 virtual WebTaskRunner* taskRunner() = 0; |
51 virtual ReferrerPolicy referrerPolicy() = 0; | 52 virtual ReferrerPolicy referrerPolicy() = 0; |
52 virtual SecurityOrigin* securityOrigin() = 0; | 53 virtual SecurityOrigin* securityOrigin() = 0; |
53 | 54 |
54 // https://html.spec.whatwg.org/#resolve-a-module-specifier | 55 // https://html.spec.whatwg.org/#resolve-a-module-specifier |
55 static KURL resolveModuleSpecifier(const String& moduleRequest, | 56 static KURL resolveModuleSpecifier(const String& moduleRequest, |
56 const KURL& baseURL); | 57 const KURL& baseURL); |
57 | 58 |
58 virtual ScriptModule compileModule(const String& script, | 59 virtual ScriptModule compileModule(const String& script, |
59 const String& urlStr) = 0; | 60 const String& urlStr, |
| 61 AccessControlStatus) = 0; |
60 | 62 |
61 private: | 63 private: |
62 friend class ModuleMap; | 64 friend class ModuleMap; |
63 | 65 |
64 // Fetches a single module script. | 66 // Fetches a single module script. |
65 // This is triggered from fetchSingle() implementation (which is in ModuleMap) | 67 // This is triggered from fetchSingle() implementation (which is in ModuleMap) |
66 // if the cached entry doesn't exist. | 68 // if the cached entry doesn't exist. |
67 // The client can be notified either synchronously or asynchronously. | 69 // The client can be notified either synchronously or asynchronously. |
68 virtual void fetchNewSingleModule(const ModuleScriptFetchRequest&, | 70 virtual void fetchNewSingleModule(const ModuleScriptFetchRequest&, |
69 ModuleGraphLevel, | 71 ModuleGraphLevel, |
70 ModuleScriptLoaderClient*) = 0; | 72 ModuleScriptLoaderClient*) = 0; |
71 }; | 73 }; |
72 | 74 |
73 } // namespace blink | 75 } // namespace blink |
74 | 76 |
75 #endif | 77 #endif |
OLD | NEW |