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

Unified Diff: third_party/WebKit/Source/platform/WebTaskRunner.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/platform/WebTaskRunner.cpp
diff --git a/third_party/WebKit/Source/platform/WebTaskRunner.cpp b/third_party/WebKit/Source/platform/WebTaskRunner.cpp
index e44dc1c6aed4b5fe8d55c150f2a306dcac845b34..8a376954c2284513de8a8c177234171f77f52938 100644
--- a/third_party/WebKit/Source/platform/WebTaskRunner.cpp
+++ b/third_party/WebKit/Source/platform/WebTaskRunner.cpp
@@ -8,19 +8,24 @@
namespace blink {
-void WebTaskRunner::postTask(const WebTraceLocation& location, PassOwnPtr<ClosureTask> task)
+void WebTaskRunner::postTask(const WebTraceLocation& location, PassOwnPtr<CrossThreadClosure> task)
{
- postTask(std::move(location), new blink::Task(std::move(task)));
+ postTask(std::move(location), new CrossThreadTask(std::move(task)));
}
-void WebTaskRunner::postDelayedTask(const WebTraceLocation& location, PassOwnPtr <ClosureTask> task, long long delayMs)
+void WebTaskRunner::postDelayedTask(const WebTraceLocation& location, PassOwnPtr<CrossThreadClosure> task, long long delayMs)
{
- postDelayedTask(location, new blink::Task(std::move(task)), delayMs);
+ postDelayedTask(std::move(location), new CrossThreadTask(std::move(task)), delayMs);
tzik 2016/03/02 11:54:29 std::move(location) takes no effect. Can we just u
hiroshige 2016/03/03 02:21:07 Done.
}
-void WebTaskRunner::postDelayedTask(const WebTraceLocation& location, PassOwnPtr <ClosureTask> task, double delayMs)
+void WebTaskRunner::postTask(const WebTraceLocation& location, PassOwnPtr<Closure> task)
{
- postDelayedTask(location, new blink::Task(std::move(task)), delayMs);
+ postTask(std::move(location), new SameThreadTask(std::move(task)));
+}
+
+void WebTaskRunner::postDelayedTask(const WebTraceLocation& location, PassOwnPtr <Closure> task, long long delayMs)
+{
+ postDelayedTask(location, new SameThreadTask(std::move(task)), delayMs);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698