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

Unified Diff: third_party/WebKit/Source/core/loader/modulescript/WorkletModuleScriptFetcher.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/WorkletModuleScriptFetcher.h
diff --git a/third_party/WebKit/Source/core/loader/modulescript/WorkletModuleScriptFetcher.h b/third_party/WebKit/Source/core/loader/modulescript/WorkletModuleScriptFetcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..476fa93924748b81f101bbcf61899ed839b94f87
--- /dev/null
+++ b/third_party/WebKit/Source/core/loader/modulescript/WorkletModuleScriptFetcher.h
@@ -0,0 +1,45 @@
+// 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 WorkletModuleScriptFetcher_h
+#define WorkletModuleScriptFetcher_h
+
+#include "core/loader/modulescript/ModuleScriptFetcher.h"
+
+#include "core/workers/WorkletModuleResponsesMap.h"
+#include "core/workers/WorkletModuleResponsesMapProxy.h"
+#include "platform/wtf/Optional.h"
+
+namespace blink {
+
+class WorkletModuleScriptFetcher final
+ : public ModuleScriptFetcher,
+ public WorkletModuleResponsesMap::Client {
+ USING_GARBAGE_COLLECTED_MIXIN(WorkletModuleScriptFetcher);
+
+ public:
+ CORE_EXPORT WorkletModuleScriptFetcher(FetchParameters,
+ ResourceFetcher*,
+ Modulator*,
+ WorkletModuleResponsesMapProxy*);
+
+ // Implements WorkletModuleResponsesMap::Client.
+ void OnRead(const ModuleScriptCreationParams&) override;
+ void OnFetchNeeded() override;
+ void OnFailed() override;
+
+ DECLARE_TRACE();
+
+ private:
+ void FetchInternal() override;
+
+ void Finalize(WTF::Optional<ModuleScriptCreationParams>) override;
+
+ Member<WorkletModuleResponsesMapProxy> module_responses_map_proxy_;
+ bool was_fetched_via_network_ = false;
+};
+
+} // namespace blink
+
+#endif // WorkletModuleScriptFetcher_h

Powered by Google App Engine
This is Rietveld 408576698