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

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

Issue 2704323002: [ES6 modules] Introduce ModuleMap (Closed)
Patch Set: Created 3 years, 10 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef ModuleMap_h
6 #define ModuleMap_h
7
8 #include "core/CoreExport.h"
9 #include "platform/heap/Handle.h"
10 #include "platform/weborigin/KURL.h"
11 #include "platform/weborigin/KURLHash.h"
12 #include "wtf/HashMap.h"
13
14 namespace blink {
15
16 class Modulator;
17 class ModuleScript;
18 class ModuleScriptFetchRequest;
19 class SingleModuleClient;
20 enum class ModuleGraphLevel;
21
22 // A ModuleMap implements "module map" spec.
23 // https://html.spec.whatwg.org/#module-map
24 class CORE_EXPORT ModuleMap final : public GarbageCollected<ModuleMap> {
25 WTF_MAKE_NONCOPYABLE(ModuleMap);
26 class Entry;
27 class LoaderHost;
28
29 public:
30 static ModuleMap* create(Modulator* modulator) {
31 return new ModuleMap(modulator);
32 }
33 DECLARE_TRACE();
34
35 void retrieveAndFetchIfNeeded(const ModuleScriptFetchRequest&,
hiroshige 2017/02/22 01:21:31 This directly corresponds to "fetch a single modul
kouhei (in TOK) 2017/02/22 07:08:04 Done.
36 ModuleGraphLevel,
37 SingleModuleClient*);
38 ModuleScript* retrieveFetchedModuleScript(const KURL&);
hiroshige 2017/02/22 01:21:31 Can this be const method? Also this looks like a
kouhei (in TOK) 2017/02/22 07:08:04 Added const
39
40 Modulator* modulator() { return m_modulator; }
41
42 private:
43 explicit ModuleMap(Modulator*);
44 ModuleMap() = delete;
45
46 using MapImpl = HeapHashMap<KURL, Member<Entry>>;
47
48 // A module map is a map of absolute URLs to map entry.
49 MapImpl m_map;
50
51 Member<Modulator> m_modulator;
52 };
53
54 } // namespace blink
55
56 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698