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

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

Issue 1925583003: Replace AllowCrossThreadAccess() + non-GCed pointers with crossThreadUnretained() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Kuroneko_4
Patch Set: Rebase. Created 4 years, 6 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 07896af90af00783e7e8521ddab9811cb381677c..f334b9394a0d79152365d71bb502680c65bc6d90 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
@@ -194,7 +194,7 @@ void WorkerThread::start(std::unique_ptr<WorkerThreadStartupData> startupData)
return;
m_started = true;
- workerBackingThread().backingThread().postTask(BLINK_FROM_HERE, threadSafeBind(&WorkerThread::initializeOnWorkerThread, AllowCrossThreadAccess(this), passed(std::move(startupData))));
+ workerBackingThread().backingThread().postTask(BLINK_FROM_HERE, threadSafeBind(&WorkerThread::initializeOnWorkerThread, crossThreadUnretained(this), passed(std::move(startupData))));
}
void WorkerThread::terminate()
@@ -253,7 +253,7 @@ void WorkerThread::postTask(const WebTraceLocation& location, std::unique_ptr<Ex
DCHECK(isCurrentThread());
InspectorInstrumentation::asyncTaskScheduled(workerGlobalScope(), "Worker task", task.get());
}
- workerBackingThread().backingThread().postTask(location, threadSafeBind(&WorkerThread::performTaskOnWorkerThread, AllowCrossThreadAccess(this), passed(std::move(task)), isInstrumented));
+ workerBackingThread().backingThread().postTask(location, threadSafeBind(&WorkerThread::performTaskOnWorkerThread, crossThreadUnretained(this), passed(std::move(task)), isInstrumented));
}
void WorkerThread::appendDebuggerTask(std::unique_ptr<CrossThreadClosure> task)
@@ -264,13 +264,13 @@ void WorkerThread::appendDebuggerTask(std::unique_ptr<CrossThreadClosure> task)
if (m_terminated)
return;
}
- m_inspectorTaskRunner->appendTask(threadSafeBind(&WorkerThread::performDebuggerTaskOnWorkerThread, AllowCrossThreadAccess(this), passed(std::move(task))));
+ m_inspectorTaskRunner->appendTask(threadSafeBind(&WorkerThread::performDebuggerTaskOnWorkerThread, crossThreadUnretained(this), passed(std::move(task))));
{
MutexLocker lock(m_threadStateMutex);
if (isolate() && !m_readyToShutdown)
m_inspectorTaskRunner->interruptAndRunAllTasksDontWait(isolate());
}
- workerBackingThread().backingThread().postTask(BLINK_FROM_HERE, threadSafeBind(&WorkerThread::performDebuggerTaskDontWaitOnWorkerThread, AllowCrossThreadAccess(this)));
+ workerBackingThread().backingThread().postTask(BLINK_FROM_HERE, threadSafeBind(&WorkerThread::performDebuggerTaskDontWaitOnWorkerThread, crossThreadUnretained(this)));
}
void WorkerThread::startRunningDebuggerTasksOnPauseOnWorkerThread()
@@ -419,8 +419,8 @@ void WorkerThread::terminateInternal(TerminationMode mode)
}
m_inspectorTaskRunner->kill();
- workerBackingThread().backingThread().postTask(BLINK_FROM_HERE, threadSafeBind(&WorkerThread::prepareForShutdownOnWorkerThread, AllowCrossThreadAccess(this)));
- workerBackingThread().backingThread().postTask(BLINK_FROM_HERE, threadSafeBind(&WorkerThread::performShutdownOnWorkerThread, AllowCrossThreadAccess(this)));
+ workerBackingThread().backingThread().postTask(BLINK_FROM_HERE, threadSafeBind(&WorkerThread::prepareForShutdownOnWorkerThread, crossThreadUnretained(this)));
+ workerBackingThread().backingThread().postTask(BLINK_FROM_HERE, threadSafeBind(&WorkerThread::performShutdownOnWorkerThread, crossThreadUnretained(this)));
}
void WorkerThread::forciblyTerminateExecution()

Powered by Google App Engine
This is Rietveld 408576698