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

Unified Diff: base/threading/sequenced_task_runner_handle.h

Issue 2042383004: Introduce TaskRunnerHandle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update comments Created 4 years, 6 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
« no previous file with comments | « base/base.gypi ('k') | base/threading/sequenced_task_runner_handle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e6dec1e9f88ebf8553caa4d0fbda7df9e0641a9c..7879b02bcfb9c8c48d5f01a19ab3604b33c6e917 100644
--- a/base/threading/sequenced_task_runner_handle.h
+++ b/base/threading/sequenced_task_runner_handle.h
@@ -5,37 +5,34 @@
#ifndef BASE_THREADING_SEQUENCED_TASK_RUNNER_HANDLE_H_
#define BASE_THREADING_SEQUENCED_TASK_RUNNER_HANDLE_H_
-#include "base/compiler_specific.h"
+#include "base/base_export.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/sequenced_task_runner.h"
+#include "base/threading/task_runner_handle.h"
namespace base {
+// Deprecated, see below for specifics.
+// TODO(gab): Migrate few users of this API and delete it.
class BASE_EXPORT SequencedTaskRunnerHandle {
public:
- // Returns a SequencedTaskRunner which guarantees that posted tasks will only
- // run after the current task is finished and will satisfy a SequenceChecker.
- // It should only be called if IsSet() returns true (see the comment there for
- // the requirements).
- static scoped_refptr<SequencedTaskRunner> Get();
-
- // Returns true if one of the following conditions is fulfilled:
- // 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
- // c) The current thread is a worker thread belonging to a
- // SequencedWorkerPool.
- static bool IsSet();
-
- // Binds |task_runner| to the current thread.
+ // Deprecated, use TaskRunnerHandle::GetSequenced() instead.
+ static scoped_refptr<SequencedTaskRunner> Get() {
+ return TaskRunnerHandle::GetSequenced();
+ }
+
+ // Deprecated, use TaskRunnerHandle::HasSequencedTaskScope() instead.
+ static bool IsSet() { return TaskRunnerHandle::HasSequencedTaskScope(); }
+
+ // Binds |task_runner| to the current thread. Deprecated, use
+ // TaskRunnerHandle::SequencedTaskScope instead.
explicit SequencedTaskRunnerHandle(
scoped_refptr<SequencedTaskRunner> task_runner);
~SequencedTaskRunnerHandle();
private:
- scoped_refptr<SequencedTaskRunner> task_runner_;
+ TaskRunnerHandle::SequencedTaskScope task_scope_;
DISALLOW_COPY_AND_ASSIGN(SequencedTaskRunnerHandle);
};
« no previous file with comments | « base/base.gypi ('k') | base/threading/sequenced_task_runner_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698