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

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

Issue 2539443004: Worker: Move ParentFrameTaskRunners from WorkerReportingProxy to ObjectProxy (Closed)
Patch Set: Created 4 years, 1 month 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/WorkerThread.cpp
diff --git a/third_party/WebKit/Source/core/workers/WorkerThread.cpp b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
index dfe9303c28c3af32c0602114e62e214fcd484e78..028afb22bba9a144333e7e946a7e0d0bc21ce022 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
@@ -29,13 +29,13 @@
#include "bindings/core/v8/Microtask.h"
#include "bindings/core/v8/ScriptSourceCode.h"
#include "bindings/core/v8/WorkerOrWorkletScriptController.h"
+#include "core/dom/TaskRunnerHelper.h"
#include "core/inspector/ConsoleMessageStorage.h"
#include "core/inspector/InspectorInstrumentation.h"
#include "core/inspector/InspectorTaskRunner.h"
#include "core/inspector/WorkerInspectorController.h"
#include "core/inspector/WorkerThreadDebugger.h"
#include "core/origin_trials/OriginTrialContext.h"
-#include "core/workers/ParentFrameTaskRunners.h"
#include "core/workers/ThreadedWorkletGlobalScope.h"
#include "core/workers/WorkerBackingThread.h"
#include "core/workers/WorkerClients.h"
@@ -351,10 +351,14 @@ void WorkerThread::terminateInternal(TerminationMode mode) {
break;
case TerminationMode::Graceful:
DCHECK(!m_forcibleTerminationTaskHandle.isActive());
+ // The default task runner should be legitimate here because we're
+ // sending a thread control task that is not associated with any
+ // document's frame. In addition, this is a delayed task and
+ // essentially we don't have to take care of the task order.
kinuko 2016/11/29 12:52:52 delayed task doesn't necessarily mean it doesn't t
m_forcibleTerminationTaskHandle =
- workerReportingProxy()
- .getParentFrameTaskRunners()
- ->get(TaskType::Internal)
+ Platform::current()
+ ->currentThread()
+ ->getWebTaskRunner()
->postDelayedCancellableTask(
BLINK_FROM_HERE,
WTF::bind(&WorkerThread::mayForciblyTerminateExecution,

Powered by Google App Engine
This is Rietveld 408576698