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

Unified Diff: base/task_runner.h

Issue 2823103003: Introduce TaskRunner::RunsTasksInCurrentSequence() (Closed)
Patch Set: remove RunsTasksOnCurrentThread() overrided. Created 3 years, 8 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: base/task_runner.h
diff --git a/base/task_runner.h b/base/task_runner.h
index 0421d564e6d75cdc8f7d763ba5c95a3b37169067..d1ea2391712b99379d8589df0bff89b1eda38280 100644
--- a/base/task_runner.h
+++ b/base/task_runner.h
@@ -78,7 +78,22 @@ class BASE_EXPORT TaskRunner
//
// It is valid for an implementation to always return true, or in
// general to use 'true' as a default value.
gab 2017/04/18 15:00:32 // // Drepecated: favor RunsTasksInCurrentSequence
- virtual bool RunsTasksOnCurrentThread() const = 0;
+ bool RunsTasksOnCurrentThread() const;
+
+ // Returns true iff tasks posted to this TaskRunner are sequenced
+ // with this call.
+ //
+ // In particular:
+ // - Returns true if this is a SequencedTaskRunner to which the
+ // current task was posted.
+ // - Returns true if this is a SequencedTaskRunner bound to the
+ // same sequence as the SequencedTaskRunner to which the current
+ // task was posted.
+ // - Returns true if this is a SingleThreadTaskRunner bound to
+ // the current thread.
+ // - Returns false if this is a TaskRunner that can run its tasks
+ // in parallel.
gab 2017/04/18 15:00:32 This last statement isn't true yet (SchedulerParal
+ virtual bool RunsTasksInCurrentSequence() const = 0;
// Posts |task| on the current TaskRunner. On completion, |reply|
// is posted to the thread that called PostTaskAndReply(). Both

Powered by Google App Engine
This is Rietveld 408576698