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

Unified Diff: third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.h

Issue 2312493002: [worklets] Introduce ThreadedWorkletMessagingProxy and AnimationWorkletMessagaingProxy. (Closed)
Patch Set: rebase. Created 4 years, 3 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/ThreadedWorkletObjectProxy.h
diff --git a/third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.h b/third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.h
new file mode 100644
index 0000000000000000000000000000000000000000..af8ff3772a7e8d25b187f5bfca4a0f38fc25516c
--- /dev/null
+++ b/third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.h
@@ -0,0 +1,55 @@
+// Copyright 2016 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 ThreadedWorkletObjectProxy_h
+#define ThreadedWorkletObjectProxy_h
+
+#include "bindings/core/v8/SourceLocation.h"
+#include "core/CoreExport.h"
+#include "core/dom/MessagePort.h"
+#include "core/workers/WorkerReportingProxy.h"
+
+namespace blink {
+
+class ConsoleMessage;
+class ExecutionContext;
+class ExecutionContextTask;
+class ThreadedWorkletMessagingProxy;
+
+// A proxy to talk to the parent worklet object. This object is created on the
+// main thread, passed on to the worklet thread, and used just to proxy
+// messages to the ThreadedWorkletMessagingProxy on the main thread.
+class CORE_EXPORT ThreadedWorkletObjectProxy : public WorkerReportingProxy {
+ USING_FAST_MALLOC(ThreadedWorkletObjectProxy);
+ WTF_MAKE_NONCOPYABLE(ThreadedWorkletObjectProxy);
+
+public:
+ static std::unique_ptr<ThreadedWorkletObjectProxy> create(ThreadedWorkletMessagingProxy*);
+ ~ThreadedWorkletObjectProxy() override {}
+
+ void postTaskToMainExecutionContext(std::unique_ptr<ExecutionContextTask>);
+ void reportPendingActivity(bool hasPendingActivity);
+
+ // WorkerReportingProxy overrides.
+ void reportException(const String& errorMessage, std::unique_ptr<SourceLocation>, int exceptionId) override {}
+ void reportConsoleMessage(MessageSource, MessageLevel, const String& message, SourceLocation*) override;
+ void postMessageToPageInspector(const String&) override;
+ void didEvaluateWorkerScript(bool success) override {}
+ void didCloseWorkerGlobalScope() override;
+ void willDestroyWorkerGlobalScope() override {}
+ void didTerminateWorkerThread() override;
+
+protected:
+ ThreadedWorkletObjectProxy(ThreadedWorkletMessagingProxy*);
+
+private:
+ ExecutionContext* getExecutionContext() const;
+
+ // This object always outlives this proxy.
+ ThreadedWorkletMessagingProxy* m_messagingProxy;
+};
+
+} // namespace blink
+
+#endif // ThreadedWorkletObjectProxy_h

Powered by Google App Engine
This is Rietveld 408576698