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

Unified Diff: third_party/WebKit/Source/core/workers/WorkletModuleResponsesMapProxy.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/workers/WorkletModuleResponsesMapProxy.h
diff --git a/third_party/WebKit/Source/core/workers/WorkletModuleResponsesMapProxy.h b/third_party/WebKit/Source/core/workers/WorkletModuleResponsesMapProxy.h
new file mode 100644
index 0000000000000000000000000000000000000000..8e276867b874fe878db8d5c315aa1821d80d400a
--- /dev/null
+++ b/third_party/WebKit/Source/core/workers/WorkletModuleResponsesMapProxy.h
@@ -0,0 +1,49 @@
+// 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 WorkletModuleResponsesMapProxy_h
+#define WorkletModuleResponsesMapProxy_h
+
+#include "platform/heap/Heap.h"
+
+#include "core/CoreExport.h"
+#include "core/workers/WorkletModuleResponsesMap.h"
+#include "platform/WebTaskRunner.h"
+#include "platform/weborigin/KURL.h"
+#include "platform/wtf/Functional.h"
+#include "platform/wtf/Optional.h"
+
+namespace blink {
+
+class ModuleScriptCreationParams;
+
+// A proxy class to talk to WorkletModuleResponsesMap on the main thread from
+// WorkletGlobalScope on the worklet context thread. The constructor and all
+// public functions must be called on the worklet context thread.
+class CORE_EXPORT WorkletModuleResponsesMapProxy
+ : public GarbageCollectedFinalized<WorkletModuleResponsesMapProxy> {
+ public:
+ using Client = WorkletModuleResponsesMap::Client;
+ WorkletModuleResponsesMapProxy(
+ WorkletModuleResponsesMap*,
+ RefPtr<WebTaskRunner> outside_settings_task_runner,
+ RefPtr<WebTaskRunner> inside_settings_task_runner);
+
+ void ReadEntry(const KURL&, Client*);
+ void UpdateEntry(const KURL&, const ModuleScriptCreationParams&);
+ void InvalidateEntry(const KURL&);
+
+ DECLARE_TRACE();
+
+ private:
+ void ReadEntryOnMainThread(const KURL&, Client*);
+
+ CrossThreadPersistent<WorkletModuleResponsesMap> module_responses_map_;
+ RefPtr<WebTaskRunner> outside_settings_task_runner_;
+ RefPtr<WebTaskRunner> inside_settings_task_runner_;
+};
+
+} // namespace blink
+
+#endif // WorkletModuleResponsesMapProxy_h

Powered by Google App Engine
This is Rietveld 408576698