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

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

Issue 2555653002: [WIP Prototype] ES6 https://html.spec.whatwg.org/#fetch-a-single-module-script implementation (Closed)
Patch Set: address haraken/yhirano comments Created 3 years, 11 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 "platform/heap/Handle.h"
9 #include "platform/weborigin/KURL.h"
10 #include "platform/weborigin/KURLHash.h"
11 #include "wtf/HashMap.h"
12
13 namespace blink {
14
15 class Modulator;
16 class ModuleScript;
17 class SingleModuleClient;
18
19 // A ModuleMap implements "module map" spec.
20 // https://html.spec.whatwg.org/#module-map
21 class ModuleMap final : public GarbageCollected<ModuleMap> {
22 WTF_MAKE_NONCOPYABLE(ModuleMap);
23 class Entry;
24 class LoaderHost;
25
26 public:
27 static ModuleMap* create(Modulator* modulator) {
28 return new ModuleMap(modulator);
29 }
30 DECLARE_TRACE();
31
32 void retrieveAndFetchIfNeeded(const KURL&,
33 const KURL& baseURL,
34 SingleModuleClient*);
35 ModuleScript* retrieveFetchedModuleScript(const KURL&);
36
37 Modulator* modulator() { return m_modulator; }
38
39 private:
40 explicit ModuleMap(Modulator*);
41 ModuleMap() = delete;
42
43 using MapImpl = HeapHashMap<KURL, Member<Entry>>;
44
45 // A module map is a map of absolute URLs to map entry.
46 MapImpl m_map;
47
48 Member<Modulator> m_modulator;
49 };
50
51 } // namespace blink
52
53 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698