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

Unified 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: 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinkerRegistry.cpp
diff --git a/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinkerRegistry.cpp b/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinkerRegistry.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..c39ee8f90036b4e7e66c890cb1600d186733bbd8
--- /dev/null
+++ b/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinkerRegistry.cpp
@@ -0,0 +1,39 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/loader/modulescript/ModuleTreeLinkerRegistry.h"
+
+#include "core/loader/modulescript/ModuleTreeLinker.h"
+#include "platform/weborigin/KURL.h"
+#include "platform/weborigin/KURLHash.h"
+
+namespace blink {
+
+DEFINE_TRACE(ModuleTreeLinkerRegistry) {
+ visitor->trace(m_activeTreeLinkers);
+}
+
+ModuleTreeLinker* ModuleTreeLinkerRegistry::fetch(
+ const ModuleScriptFetchRequest& request,
+ const AncestorList& ancestorList,
+ ModuleGraphLevel level,
+ Modulator* modulator,
+ ModuleTreeClient* client) {
+ ModuleTreeLinker* fetcher = ModuleTreeLinker::fetch(
+ request, ancestorList, level, modulator, this, client);
+ DCHECK(fetcher->isFetching());
+ m_activeTreeLinkers.insert(fetcher);
+ return fetcher;
+}
+
+void ModuleTreeLinkerRegistry::releaseFinishedFetcher(
+ ModuleTreeLinker* fetcher) {
+ DCHECK(fetcher->hasFinished());
+
+ auto it = m_activeTreeLinkers.find(fetcher);
+ DCHECK_NE(it, m_activeTreeLinkers.end());
+ m_activeTreeLinkers.erase(it);
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698