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

Unified Diff: base/threading/sequenced_task_runner_handle.h

Issue 1911023002: TaskScheduler: Add TaskRunnerHandle support to TaskScheduler tasks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@c1_1876363004_STTR
Patch Set: merge up to r390520 Created 4 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/threading/sequenced_task_runner_handle.h
diff --git a/base/threading/sequenced_task_runner_handle.h b/base/threading/sequenced_task_runner_handle.h
index 7084ec4bb9bf879caad480e9393bb70d05756b43..e6da18d215d4c6825dbfe093634a09b46ef57992 100644
--- a/base/threading/sequenced_task_runner_handle.h
+++ b/base/threading/sequenced_task_runner_handle.h
@@ -22,14 +22,23 @@ class BASE_EXPORT SequencedTaskRunnerHandle {
static scoped_refptr<SequencedTaskRunner> Get();
// Returns true if one of the following conditions is fulfilled:
- // a) The current thread has a ThreadTaskRunnerHandle (which includes any
+ // a) A SequencedTaskRunner has been assigned to the current thread by
+ // instantiating a SequencedTaskRunnerHandle.
+ // b) The current thread has a ThreadTaskRunnerHandle (which includes any
// thread that has a MessageLoop associated with it), or
- // b) The current thread is a worker thread belonging to a
+ // c) The current thread is a worker thread belonging to a
// SequencedWorkerPool.
static bool IsSet();
+ // Binds |task_runner| to the current thread.
+ explicit SequencedTaskRunnerHandle(
+ scoped_refptr<SequencedTaskRunner> task_runner);
+ ~SequencedTaskRunnerHandle();
+
private:
- DISALLOW_IMPLICIT_CONSTRUCTORS(SequencedTaskRunnerHandle);
+ scoped_refptr<SequencedTaskRunner> task_runner_;
+
+ DISALLOW_COPY_AND_ASSIGN(SequencedTaskRunnerHandle);
};
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698