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

Unified Diff: third_party/WebKit/public/platform/WebTaskRunner.h

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/public/platform/WebTaskRunner.h
diff --git a/third_party/WebKit/public/platform/WebTaskRunner.h b/third_party/WebKit/public/platform/WebTaskRunner.h
index 5763817588e9e9bd9082418e5c2764b648b0d54b..76409bcce4616062a08ec106b5fcdb36f259ce69 100644
--- a/third_party/WebKit/public/platform/WebTaskRunner.h
+++ b/third_party/WebKit/public/platform/WebTaskRunner.h
@@ -57,12 +57,14 @@ public:
#ifdef INSIDE_BLINK
// Helpers for posting bound functions as tasks.
- typedef Function<void()> ClosureTask;
- void postTask(const WebTraceLocation&, PassOwnPtr<ClosureTask>);
- // TODO(alexclarke): Remove this when possible.
- void postDelayedTask(const WebTraceLocation&, PassOwnPtr<ClosureTask>, long long delayMs);
- void postDelayedTask(const WebTraceLocation&, PassOwnPtr<ClosureTask>, double delayMs);
+ // For cross-thread posting. Can be called from any thread.
+ void postTask(const WebTraceLocation&, PassOwnPtr<CrossThreadClosure>);
+ void postDelayedTask(const WebTraceLocation&, PassOwnPtr<CrossThreadClosure>, long long delayMs);
+
+ // For same-thread posting. Must be called from the associated WebThread.
+ void postTask(const WebTraceLocation&, PassOwnPtr<Closure>);
+ void postDelayedTask(const WebTraceLocation&, PassOwnPtr<Closure>, long long delayMs);
PassOwnPtr<WebTaskRunner> adoptClone()
{
« third_party/WebKit/Source/wtf/Functional.h ('K') | « third_party/WebKit/Source/wtf/Functional.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698