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

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

Issue 1549143002: Add thread affinity and ASSERT() for same-thread restriction to WTF::Function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@TRV_ThreadSafeBindByVariadicTemplate
Patch Set: Created 4 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 bb5bb46c7708830080177d81d4d618f2c919daf0..a9044aacc5ef22c15338c21f7be405be534c2989 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
@@ -122,7 +122,7 @@ void WorkerThread::performTask(PassOwnPtr<ExecutionContextTask> task, bool isIns
InspectorInstrumentation::didPerformExecutionContextTask(globalScope);
}
-PassOwnPtr<Closure> WorkerThread::createWorkerThreadTask(PassOwnPtr<ExecutionContextTask> task, bool isInstrumented)
+PassOwnPtr<CrossThreadClosure> WorkerThread::createWorkerThreadTask(PassOwnPtr<ExecutionContextTask> task, bool isInstrumented)
{
if (isInstrumented)
isInstrumented = !task->taskNameForInstrumentation().isEmpty();
@@ -137,7 +137,7 @@ PassOwnPtr<Closure> WorkerThread::createWorkerThreadTask(PassOwnPtr<ExecutionCon
class WorkerThread::DebuggerTaskQueue {
WTF_MAKE_NONCOPYABLE(DebuggerTaskQueue);
public:
- using Task = WTF::Closure;
+ using Task = WTF::CrossThreadClosure;
using Result = WorkerThread::TaskQueueResult;
DebuggerTaskQueue() { }
@@ -494,7 +494,7 @@ void WorkerThread::terminateV8Execution()
m_isolate->TerminateExecution();
}
-void WorkerThread::appendDebuggerTask(PassOwnPtr<Closure> task)
+void WorkerThread::appendDebuggerTask(PassOwnPtr<CrossThreadClosure> task)
{
{
MutexLocker lock(m_threadStateMutex);
@@ -509,7 +509,7 @@ WorkerThread::TaskQueueResult WorkerThread::runDebuggerTask(WaitMode waitMode)
ASSERT(isCurrentThread());
TaskQueueResult result;
double absoluteTime = DebuggerTaskQueue::infiniteTime();
- OwnPtr<Closure> task;
+ OwnPtr<CrossThreadClosure> task;
{
if (waitMode == DontWaitForTask)
absoluteTime = 0.0;

Powered by Google App Engine
This is Rietveld 408576698