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

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

Issue 2555653002: [WIP Prototype] ES6 https://html.spec.whatwg.org/#fetch-a-single-module-script implementation (Closed)
Patch Set: ModuleScriptLoaderTest 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/ModuleScriptLoaderRegistry.h"
6
7 #include "core/loader/modulescript/ModuleScriptLoader.h"
8
9 namespace blink {
10
11 DEFINE_TRACE(ModuleScriptLoaderRegistry) {
12 visitor->trace(m_activeLoaders);
13 }
14
15 ModuleScriptLoader* ModuleScriptLoaderRegistry::fetch(
16 const KURL& url,
17 const KURL& baseURL,
18 ModuleController* moduleController,
19 ResourceFetcher* fetcher,
20 ModuleScriptLoaderClient* client) {
21 ModuleScriptLoader* loader =
22 ModuleScriptLoader::create(url, baseURL, moduleController, this, client);
23 DCHECK(loader->isInitialState());
24 m_activeLoaders.add(loader);
25 loader->fetch(fetcher);
26 return loader;
27 }
28
29 void ModuleScriptLoaderRegistry::releaseFinishedLoader(
30 ModuleScriptLoader* loader) {
31 DCHECK(loader->hasFinished());
32
33 auto it = m_activeLoaders.find(loader);
34 DCHECK_NE(it, m_activeLoaders.end());
35 m_activeLoaders.remove(it);
36 }
37
38 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698