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

Side by Side Diff: third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinkerRegistry.cpp

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 #include "core/loader/modulescript/ModuleTreeLinkerRegistry.h"
6
7 #include "core/loader/modulescript/ModuleTreeLinker.h"
8 #include "platform/weborigin/KURL.h"
9 #include "platform/weborigin/KURLHash.h"
10
11 namespace blink {
12
13 DEFINE_TRACE(ModuleTreeLinkerRegistry) {
14 visitor->trace(m_activeTreeLinkers);
15 }
16
17 ModuleTreeLinker* ModuleTreeLinkerRegistry::fetch(const KURL& url,
18 const KURL& baseURL,
19 HashSet<KURL> ancestorList,
20 Modulator* modulator,
21 ModuleTreeClient* client) {
22 ModuleTreeLinker* fetcher = ModuleTreeLinker::fetch(
23 url, baseURL, std::move(ancestorList), modulator, this, client);
24 DCHECK(fetcher->isFetching());
25 m_activeTreeLinkers.add(fetcher);
26 return fetcher;
27 }
28
29 void ModuleTreeLinkerRegistry::releaseFinishedFetcher(
30 ModuleTreeLinker* fetcher) {
31 DCHECK(fetcher->hasFinished());
32
33 auto it = m_activeTreeLinkers.find(fetcher);
34 DCHECK_NE(it, m_activeTreeLinkers.end());
35 m_activeTreeLinkers.remove(it);
36 }
37
38 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698