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

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

Issue 2566623002: Worker: Factor out common functions into ThreadedObjectProxyBase (Closed)
Patch Set: fix layout tests Created 4 years 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
index 4c04c47f9f4515c36c1676144b3238e66ff7c13d..78bbe6294b2ccc07d4d892fb5ea3e1ab04e8cc25 100644
--- a/third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.h
+++ b/third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.h
@@ -8,17 +8,16 @@
#include "bindings/core/v8/SourceLocation.h"
#include "core/CoreExport.h"
#include "core/dom/MessagePort.h"
+#include "core/workers/ThreadedObjectProxyBase.h"
#include "core/workers/WorkerReportingProxy.h"
namespace blink {
class ThreadedWorkletMessagingProxy;
-// A proxy to talk to the parent worklet object. This object is created and
-// destroyed on the main thread, and used on the worklet thread for proxying
-// messages to the ThreadedWorkletMessagingProxy on the main thread.
-// ThreadedWorkletMessagingProxy always outlives this proxy.
-class CORE_EXPORT ThreadedWorkletObjectProxy : public WorkerReportingProxy {
+// A proxy to talk to the parent worker object. See class comments on
+// ThreadedObjectProxyBase.h for lifetime of this class etc.
+class CORE_EXPORT ThreadedWorkletObjectProxy : public ThreadedObjectProxyBase {
USING_FAST_MALLOC(ThreadedWorkletObjectProxy);
WTF_MAKE_NONCOPYABLE(ThreadedWorkletObjectProxy);
@@ -30,36 +29,24 @@ class CORE_EXPORT ThreadedWorkletObjectProxy : public WorkerReportingProxy {
void reportPendingActivity(bool hasPendingActivity);
- // WorkerReportingProxy overrides.
- void countFeature(UseCounter::Feature) override;
- void countDeprecation(UseCounter::Feature) override;
+ // ThreadedObjectProxyBase 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;
- ParentFrameTaskRunners* getParentFrameTaskRunners() override;
- void didEvaluateWorkerScript(bool success) override {}
- void didCloseWorkerGlobalScope() override;
- void willDestroyWorkerGlobalScope() override {}
- void didTerminateWorkerThread() override;
+ int exceptionId) final {}
+ void didEvaluateWorkerScript(bool success) final {}
+ void willDestroyWorkerGlobalScope() final {}
protected:
ThreadedWorkletObjectProxy(const WeakPtr<ThreadedWorkletMessagingProxy>&,
ParentFrameTaskRunners*);
+ WeakPtr<ThreadedMessagingProxyBase> messagingProxyWeakPtr() final;
+
private:
// No guarantees about the lifetimes of tasks posted by this proxy wrt the
// ThreadedWorkletMessagingProxy so a weak pointer must be used when posting
// the tasks.
WeakPtr<ThreadedWorkletMessagingProxy> m_messagingProxyWeakPtr;
-
- // Used to post a task to ThreadedWorkletMessagingProxy on the parent context
- // thread.
- CrossThreadPersistent<ParentFrameTaskRunners> m_parentFrameTaskRunners;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698