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..5d4892ce1289b7251374d09bfe44fdd8bde96d33 |
--- /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 Modulator; |
+class ModuleScriptLoader; |
+class ModuleScriptLoaderClient; |
+class ResourceFetcher; |
+ |
+// 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, |
+ Modulator*, |
+ ResourceFetcher*, |
+ ModuleScriptLoaderClient*); |
+ |
+ private: |
+ ModuleScriptLoaderRegistry() = default; |
+ |
+ friend class ModuleScriptLoader; |
+ void releaseFinishedLoader(ModuleScriptLoader*); |
+ |
+ HeapHashSet<Member<ModuleScriptLoader>> m_activeLoaders; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif |