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 ModuleMap_h | 5 #ifndef ModuleMap_h |
6 #define ModuleMap_h | 6 #define ModuleMap_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "platform/bindings/ScriptWrappable.h" | 9 #include "platform/bindings/ScriptWrappable.h" |
10 #include "platform/bindings/TraceWrapperMember.h" | 10 #include "platform/bindings/TraceWrapperMember.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 } | 34 } |
35 DECLARE_TRACE(); | 35 DECLARE_TRACE(); |
36 DECLARE_TRACE_WRAPPERS(); | 36 DECLARE_TRACE_WRAPPERS(); |
37 | 37 |
38 // https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-single-modul
e-script | 38 // https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-single-modul
e-script |
39 void FetchSingleModuleScript(const ModuleScriptFetchRequest&, | 39 void FetchSingleModuleScript(const ModuleScriptFetchRequest&, |
40 ModuleGraphLevel, | 40 ModuleGraphLevel, |
41 SingleModuleClient*); | 41 SingleModuleClient*); |
42 | 42 |
43 // Synchronously get the ModuleScript for a given URL. | 43 // Synchronously get the ModuleScript for a given URL. |
44 // Note: fetchSingleModuleScript of the ModuleScript must be complete before | 44 // If the URL wasn't fetched, or is currently being fetched, this returns a |
45 // calling this. | 45 // nullptr. |
46 ModuleScript* GetFetchedModuleScript(const KURL&) const; | 46 ModuleScript* GetFetchedModuleScript(const KURL&) const; |
47 | 47 |
48 Modulator* GetModulator() { return modulator_; } | 48 Modulator* GetModulator() { return modulator_; } |
49 | 49 |
50 private: | 50 private: |
51 explicit ModuleMap(Modulator*); | 51 explicit ModuleMap(Modulator*); |
52 | 52 |
53 using MapImpl = HeapHashMap<KURL, TraceWrapperMember<Entry>>; | 53 using MapImpl = HeapHashMap<KURL, TraceWrapperMember<Entry>>; |
54 | 54 |
55 // A module map is a map of absolute URLs to map entry. | 55 // A module map is a map of absolute URLs to map entry. |
56 MapImpl map_; | 56 MapImpl map_; |
57 | 57 |
58 Member<Modulator> modulator_; | 58 Member<Modulator> modulator_; |
59 }; | 59 }; |
60 | 60 |
61 } // namespace blink | 61 } // namespace blink |
62 | 62 |
63 #endif | 63 #endif |
OLD | NEW |