Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(486)

Side by Side Diff: third_party/WebKit/Source/core/dom/ModuleMap.h

Issue 2788513003: [ES6 modules] Make ModuleMap TraceWrapperBase (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "bindings/core/v8/ScriptWrappable.h"
9 #include "bindings/core/v8/TraceWrapperMember.h"
8 #include "core/CoreExport.h" 10 #include "core/CoreExport.h"
9 #include "platform/heap/Handle.h" 11 #include "platform/heap/Handle.h"
10 #include "platform/weborigin/KURL.h" 12 #include "platform/weborigin/KURL.h"
11 #include "platform/weborigin/KURLHash.h" 13 #include "platform/weborigin/KURLHash.h"
12 #include "wtf/HashMap.h" 14 #include "wtf/HashMap.h"
13 15
14 namespace blink { 16 namespace blink {
15 17
16 class Modulator; 18 class Modulator;
17 class ModuleScript; 19 class ModuleScript;
18 class ModuleScriptFetchRequest; 20 class ModuleScriptFetchRequest;
19 class SingleModuleClient; 21 class SingleModuleClient;
20 enum class ModuleGraphLevel; 22 enum class ModuleGraphLevel;
21 23
22 // A ModuleMap implements "module map" spec. 24 // A ModuleMap implements "module map" spec.
23 // https://html.spec.whatwg.org/#module-map 25 // https://html.spec.whatwg.org/#module-map
24 class CORE_EXPORT ModuleMap final : public GarbageCollected<ModuleMap> { 26 class CORE_EXPORT ModuleMap final : public GarbageCollected<ModuleMap>,
27 public TraceWrapperBase {
25 WTF_MAKE_NONCOPYABLE(ModuleMap); 28 WTF_MAKE_NONCOPYABLE(ModuleMap);
26 class Entry; 29 class Entry;
27 class LoaderHost;
28 30
29 public: 31 public:
30 static ModuleMap* create(Modulator* modulator) { 32 static ModuleMap* create(Modulator* modulator) {
31 return new ModuleMap(modulator); 33 return new ModuleMap(modulator);
32 } 34 }
33 DECLARE_TRACE(); 35 DECLARE_TRACE();
36 DECLARE_VIRTUAL_TRACE_WRAPPERS();
yhirano 2017/04/05 05:56:46 No _VIRTUAL_ is needed?
kouhei (in TOK) 2017/04/05 07:51:43 Done.
34 37
35 // 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
36 void fetchSingleModuleScript(const ModuleScriptFetchRequest&, 39 void fetchSingleModuleScript(const ModuleScriptFetchRequest&,
37 ModuleGraphLevel, 40 ModuleGraphLevel,
38 SingleModuleClient*); 41 SingleModuleClient*);
39 42
40 // Synchronously get the ModuleScript for a given URL. 43 // Synchronously get the ModuleScript for a given URL.
41 // Note: fetchSingleModuleScript of the ModuleScript must be complete before 44 // Note: fetchSingleModuleScript of the ModuleScript must be complete before
42 // calling this. 45 // calling this.
43 ModuleScript* getFetchedModuleScript(const KURL&) const; 46 ModuleScript* getFetchedModuleScript(const KURL&) const;
44 47
45 Modulator* modulator() { return m_modulator; } 48 Modulator* modulator() { return m_modulator; }
46 49
47 private: 50 private:
48 explicit ModuleMap(Modulator*); 51 explicit ModuleMap(Modulator*);
49 52
50 using MapImpl = HeapHashMap<KURL, Member<Entry>>; 53 using MapImpl = HeapHashMap<KURL, TraceWrapperMember<Entry>>;
51 54
52 // 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.
53 MapImpl m_map; 56 MapImpl m_map;
54 57
55 Member<Modulator> m_modulator; 58 Member<Modulator> m_modulator;
56 }; 59 };
57 60
58 } // namespace blink 61 } // namespace blink
59 62
60 #endif 63 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ModuleMap.cpp » ('j') | third_party/WebKit/Source/core/dom/ModuleMap.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698