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