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

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

Issue 2718643002: Worker: Pass ParentFrameTaskRunners via WorkerThread::start() instead of the ctor (Closed)
Patch Set: Created 3 years, 10 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/WorkerThread.cpp
diff --git a/third_party/WebKit/Source/core/workers/WorkerThread.cpp b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
index 17b2c4a51c486a666f1da75a5c7b1832f15cf5e7..4401616c834082d49ee317be279be78917a56e13 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
@@ -104,13 +104,15 @@ WorkerThread::~WorkerThread() {
exitCodeHistogram.count(static_cast<int>(m_exitCode));
}
-void WorkerThread::start(std::unique_ptr<WorkerThreadStartupData> startupData) {
+void WorkerThread::start(std::unique_ptr<WorkerThreadStartupData> startupData,
+ ParentFrameTaskRunners* parentFrameTaskRunners) {
DCHECK(isMainThread());
if (m_requestedToStart)
return;
m_requestedToStart = true;
+ m_parentFrameTaskRunners = parentFrameTaskRunners;
workerBackingThread().backingThread().postTask(
BLINK_FROM_HERE, crossThreadBind(&WorkerThread::initializeOnWorkerThread,
crossThreadUnretained(this),
@@ -284,14 +286,12 @@ bool WorkerThread::isForciblyTerminated() {
}
WorkerThread::WorkerThread(PassRefPtr<WorkerLoaderProxy> workerLoaderProxy,
- WorkerReportingProxy& workerReportingProxy,
- ParentFrameTaskRunners* parentFrameTaskRunners)
+ WorkerReportingProxy& workerReportingProxy)
: m_workerThreadId(getNextWorkerThreadId()),
m_forcibleTerminationDelayInMs(kForcibleTerminationDelayInMs),
m_inspectorTaskRunner(WTF::makeUnique<InspectorTaskRunner>()),
m_workerLoaderProxy(workerLoaderProxy),
m_workerReportingProxy(workerReportingProxy),
- m_parentFrameTaskRunners(parentFrameTaskRunners),
m_shutdownEvent(WTF::wrapUnique(
new WaitableEvent(WaitableEvent::ResetPolicy::Manual,
WaitableEvent::InitialState::NonSignaled))),
« no previous file with comments | « third_party/WebKit/Source/core/workers/WorkerThread.h ('k') | third_party/WebKit/Source/core/workers/WorkerThreadTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698