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

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

Issue 2196133002: Revert of Pass per-frame task runners to Workers (when possible) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: crud Created 4 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/InProcessWorkerMessagingProxy.cpp
diff --git a/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp b/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp
index f9be5cb32e7167253e8870c8ad8ef513b1fa5c75..2a1d4979fefdc4efab08db7f27bc4e95ba6c2c1d 100644
--- a/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp
+++ b/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp
@@ -32,7 +32,6 @@
#include "core/dom/CrossThreadTask.h"
#include "core/dom/Document.h"
#include "core/dom/SecurityContext.h"
-#include "core/dom/TaskRunnerHelper.h"
#include "core/events/ErrorEvent.h"
#include "core/events/MessageEvent.h"
#include "core/frame/FrameConsole.h"
@@ -44,12 +43,10 @@
#include "core/origin_trials/OriginTrialContext.h"
#include "core/workers/InProcessWorkerBase.h"
#include "core/workers/InProcessWorkerObjectProxy.h"
-#include "core/workers/ParentFrameTaskRunners.h"
#include "core/workers/WorkerClients.h"
#include "core/workers/WorkerGlobalScope.h"
#include "core/workers/WorkerInspectorProxy.h"
#include "core/workers/WorkerThreadStartupData.h"
-#include "public/platform/WebTaskRunner.h"
#include "wtf/WTF.h"
#include <memory>
@@ -85,7 +82,6 @@ InProcessWorkerMessagingProxy::InProcessWorkerMessagingProxy(InProcessWorkerBase
, m_askedToTerminate(false)
, m_workerInspectorProxy(WorkerInspectorProxy::create())
, m_workerClients(workerClients)
- , m_parentFrameTaskRunners(ParentFrameTaskRunners::create(toDocument(m_executionContext.get())))
{
DCHECK(isParentContextThread());
DCHECK(m_workerObject);
@@ -172,12 +168,10 @@ bool InProcessWorkerMessagingProxy::postTaskToWorkerGlobalScope(const WebTraceLo
void InProcessWorkerMessagingProxy::postTaskToLoader(const WebTraceLocation& location, std::unique_ptr<ExecutionContextTask> task)
{
DCHECK(getExecutionContext()->isDocument());
- // TODO(hiroshige,yuryu): Make this not use ExecutionContextTask and use
- // m_parentFrameTaskRunners->getLoadingTaskRunner() instead.
getExecutionContext()->postTask(location, std::move(task));
}
-void InProcessWorkerMessagingProxy::reportException(const String& errorMessage, std::unique_ptr<SourceLocation> location, int exceptionId)
+void InProcessWorkerMessagingProxy::reportException(const String& errorMessage, std::unique_ptr<SourceLocation> location
{
DCHECK(isParentContextThread());
if (!m_workerObject)
@@ -191,7 +185,7 @@ void InProcessWorkerMessagingProxy::reportException(const String& errorMessage,
ErrorEvent* event = ErrorEvent::create(errorMessage, location->clone(), nullptr);
if (m_workerObject->dispatchEvent(event) == DispatchEventResult::NotCanceled)
- postTaskToWorkerGlobalScope(BLINK_FROM_HERE, createCrossThreadTask(&processUnhandledExceptionOnWorkerGlobalScope, exceptionId));
+ postTaskToWorkerGlobalScope(BLINK_FROM_HERE, createCrossThreadTask(&processUnhandledExceptionOnWorkerGlobalScope, 0 /* exceptionId */));
}
void InProcessWorkerMessagingProxy::reportConsoleMessage(MessageSource source, MessageLevel level, const String& message, std::unique_ptr<SourceLocation> location)
@@ -229,7 +223,7 @@ void InProcessWorkerMessagingProxy::workerObjectDestroyed()
// cleared before this method gets called.
DCHECK(!m_workerObject);
- m_parentFrameTaskRunners->getUnthrottledTaskRunner()->postTask(BLINK_FROM_HERE, WTF::bind(&InProcessWorkerMessagingProxy::workerObjectDestroyedInternal, unretained(this)));
+ getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&InProcessWorkerMessagingProxy::workerObjectDestroyedInternal, crossThreadUnretained(this)));
}
void InProcessWorkerMessagingProxy::workerObjectDestroyedInternal()

Powered by Google App Engine
This is Rietveld 408576698