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

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

Issue 2939773005: [POC] Implement "module responses map" concept (Closed)
Patch Set: rebase Created 3 years, 5 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/ModuleScriptFetcher.h
diff --git a/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptFetcher.h b/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptFetcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..2749bc4c7a7409fab083d28a4432cc29ed0bcc8a
--- /dev/null
+++ b/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptFetcher.h
@@ -0,0 +1,54 @@
+// 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 ModuleScriptFetcher_h
+#define ModuleScriptFetcher_h
+
+#include "core/dom/Modulator.h"
+#include "core/loader/modulescript/ModuleScriptCreationParams.h"
+#include "core/loader/resource/ScriptResource.h"
+#include "platform/loader/fetch/FetchParameters.h"
+#include "platform/loader/fetch/ResourceFetcher.h"
+#include "platform/loader/fetch/ResourceOwner.h"
+#include "platform/weborigin/SecurityOrigin.h"
+#include "platform/wtf/Optional.h"
+
+namespace blink {
+
+class ModuleScriptLoader;
+
+class CORE_EXPORT ModuleScriptFetcher
+ : public GarbageCollectedFinalized<ModuleScriptFetcher>,
+ public ResourceOwner<ScriptResource> {
+ USING_GARBAGE_COLLECTED_MIXIN(ModuleScriptFetcher);
+
+ public:
+ ModuleScriptFetcher(FetchParameters, ResourceFetcher*, Modulator*);
+
+ void Fetch(ModuleScriptLoader*);
+
+ // Implements ScriptResourceClient
+ void NotifyFinished(Resource*) final;
+ String DebugName() const final { return "ModuleScriptFetcher"; }
+
+ DECLARE_TRACE();
+
+ protected:
+ // 'virtual' for custom fetch.
+ virtual void FetchInternal();
+ virtual void Finalize(WTF::Optional<ModuleScriptCreationParams>);
+
+ KURL GetRequestUrl() const { return fetch_params_.Url(); }
+
+ private:
+ FetchParameters fetch_params_;
+ Member<ResourceFetcher> fetcher_;
+ Member<Modulator> modulator_;
+ Member<ModuleScriptLoader> loader_;
+ bool was_fetched_ = false;
+};
+
+} // namespace blink
+
+#endif // ModuleScriptFetcher_h

Powered by Google App Engine
This is Rietveld 408576698