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

Unified Diff: third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderRegistry.h

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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderRegistry.h
diff --git a/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderRegistry.h b/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderRegistry.h
new file mode 100644
index 0000000000000000000000000000000000000000..27f44d676c33c11d01a746869981196ce3d5afea
--- /dev/null
+++ b/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderRegistry.h
@@ -0,0 +1,46 @@
+// 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.
+
+#ifndef ModuleScriptLoaderRegistry_h
+#define ModuleScriptLoaderRegistry_h
+
+#include "core/CoreExport.h"
+#include "platform/heap/Handle.h"
+#include "platform/weborigin/KURL.h"
+#include "wtf/HashSet.h"
+
+namespace blink {
+
+class ModuleScriptLoader;
+class ModuleController;
+class ResourceFetcher;
+class ModuleScriptLoaderClient;
+
+// ModuleScriptLoaderRegistry keeps active ModuleLoaders alive.
+class CORE_EXPORT ModuleScriptLoaderRegistry final
+ : public GarbageCollected<ModuleScriptLoaderRegistry> {
+ public:
+ static ModuleScriptLoaderRegistry* create() {
+ return new ModuleScriptLoaderRegistry;
+ }
+ DECLARE_TRACE();
+
+ ModuleScriptLoader* fetch(const KURL&,
+ const KURL& baseURL,
+ ModuleController*,
+ ResourceFetcher*,
+ ModuleScriptLoaderClient*);
+
+ private:
+ ModuleScriptLoaderRegistry() = default;
+
+ friend class ModuleScriptLoader;
+ void releaseFinishedLoader(ModuleScriptLoader*);
+
+ HeapHashSet<Member<ModuleScriptLoader>> m_activeLoaders;
+};
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698