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

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

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
« no previous file with comments | « third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.cpp
diff --git a/third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.cpp b/third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.cpp
index b2b3a03192a803a9fd9ec7cb8cd22f187dca1a0d..4bee6937292d72e87d32b0e347395c7307f96fb3 100644
--- a/third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.cpp
+++ b/third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.cpp
@@ -4,13 +4,7 @@
#include "core/workers/ThreadedWorkletObjectProxy.h"
-#include "core/dom/ExecutionContext.h"
-#include "core/inspector/ConsoleMessage.h"
-#include "core/workers/ParentFrameTaskRunners.h"
#include "core/workers/ThreadedWorkletMessagingProxy.h"
-#include "platform/CrossThreadFunctional.h"
-#include "platform/WebTaskRunner.h"
-#include "wtf/Functional.h"
#include "wtf/PtrUtil.h"
#include <memory>
@@ -28,73 +22,15 @@ ThreadedWorkletObjectProxy::~ThreadedWorkletObjectProxy() {
DCHECK(m_messagingProxyWeakPtr);
}
-void ThreadedWorkletObjectProxy::countFeature(UseCounter::Feature) {
- // TODO(nhiroki): Support UseCounter for ThreadedWorklets. We could do the
- // same thing with InProcessWorkerObjectProxy here.
- // (https://crbug.com/376039)
-}
-
-void ThreadedWorkletObjectProxy::countDeprecation(UseCounter::Feature) {
- // TODO(nhiroki): Support UseCounter for ThreadedWorklets. We could do the
- // same thing with InProcessWorkerObjectProxy here.
- // (https://crbug.com/376039)
-}
-
-void ThreadedWorkletObjectProxy::reportConsoleMessage(
- MessageSource source,
- MessageLevel level,
- const String& message,
- SourceLocation* location) {
- getParentFrameTaskRunners()
- ->get(TaskType::Internal)
- ->postTask(
- BLINK_FROM_HERE,
- crossThreadBind(&ThreadedWorkletMessagingProxy::reportConsoleMessage,
- m_messagingProxyWeakPtr, source, level, message,
- WTF::passed(location->clone())));
-}
-
-void ThreadedWorkletObjectProxy::postMessageToPageInspector(
- const String& message) {
- DCHECK(m_messagingProxyWeakPtr->getExecutionContext()->isDocument());
- // The TaskType of Inspector tasks need to be Unthrottled because they need to
- // run even on a suspended page.
- getParentFrameTaskRunners()
- ->get(TaskType::Unthrottled)
- ->postTask(BLINK_FROM_HERE,
- crossThreadBind(
- &ThreadedWorkletMessagingProxy::postMessageToPageInspector,
- m_messagingProxyWeakPtr, message));
-}
-
-ParentFrameTaskRunners*
-ThreadedWorkletObjectProxy::getParentFrameTaskRunners() {
- return m_parentFrameTaskRunners.get();
-}
-
-void ThreadedWorkletObjectProxy::didCloseWorkerGlobalScope() {
- getParentFrameTaskRunners()
- ->get(TaskType::Internal)
- ->postTask(
- BLINK_FROM_HERE,
- crossThreadBind(&ThreadedWorkletMessagingProxy::terminateGlobalScope,
- m_messagingProxyWeakPtr));
-}
-
-void ThreadedWorkletObjectProxy::didTerminateWorkerThread() {
- // This will terminate the MessagingProxy.
- getParentFrameTaskRunners()
- ->get(TaskType::Internal)
- ->postTask(BLINK_FROM_HERE,
- crossThreadBind(
- &ThreadedWorkletMessagingProxy::workerThreadTerminated,
- m_messagingProxyWeakPtr));
-}
-
ThreadedWorkletObjectProxy::ThreadedWorkletObjectProxy(
const WeakPtr<ThreadedWorkletMessagingProxy>& messagingProxyWeakPtr,
ParentFrameTaskRunners* parentFrameTaskRunners)
- : m_messagingProxyWeakPtr(messagingProxyWeakPtr),
- m_parentFrameTaskRunners(parentFrameTaskRunners) {}
+ : ThreadedObjectProxyBase(parentFrameTaskRunners),
+ m_messagingProxyWeakPtr(messagingProxyWeakPtr) {}
+
+WeakPtr<ThreadedMessagingProxyBase>
+ThreadedWorkletObjectProxy::messagingProxyWeakPtr() {
+ return m_messagingProxyWeakPtr;
+}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698