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

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

Issue 2697073002: [ES6 modules] Introduce ModuleScriptLoader (Closed)
Patch Set: rebased Created 3 years, 9 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 ModuleScriptFetchRequest& request,
17 ModuleGraphLevel level,
18 Modulator* modulator,
19 ResourceFetcher* fetcher,
20 ModuleScriptLoaderClient* client) {
21 ModuleScriptLoader* loader =
22 ModuleScriptLoader::create(modulator, this, client);
23 DCHECK(loader->isInitialState());
24 m_activeLoaders.insert(loader);
25 loader->fetch(request, fetcher, level);
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.erase(it);
36 }
37
38 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698