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

Unified Diff: base/task/cancelable_task_tracker.cc

Issue 1100773004: base: Remove most uses of MessageLoopProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added some missing includes. Created 5 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
« no previous file with comments | « base/synchronization/waitable_event_watcher_posix.cc ('k') | base/task/cancelable_task_tracker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task/cancelable_task_tracker.cc
diff --git a/base/task/cancelable_task_tracker.cc b/base/task/cancelable_task_tracker.cc
index b6e4b6ac4dedfd80d546deca1fe3798a7106cfc9..a2e4799f43854485f9d077c27155683ab66ccf47 100644
--- a/base/task/cancelable_task_tracker.cc
+++ b/base/task/cancelable_task_tracker.cc
@@ -11,9 +11,10 @@
#include "base/compiler_specific.h"
#include "base/location.h"
#include "base/memory/ref_counted.h"
-#include "base/message_loop/message_loop_proxy.h"
+#include "base/single_thread_task_runner.h"
#include "base/synchronization/cancellation_flag.h"
#include "base/task_runner.h"
+#include "base/thread_task_runner_handle.h"
using base::Bind;
using base::CancellationFlag;
@@ -85,7 +86,7 @@ CancelableTaskTracker::TaskId CancelableTaskTracker::PostTaskAndReply(
DCHECK(thread_checker_.CalledOnValidThread());
// We need a MessageLoop to run reply.
- DCHECK(base::MessageLoopProxy::current().get());
+ DCHECK(base::ThreadTaskRunnerHandle::IsSet());
// Owned by reply callback below.
CancellationFlag* flag = new CancellationFlag();
@@ -113,7 +114,7 @@ CancelableTaskTracker::TaskId CancelableTaskTracker::PostTaskAndReply(
CancelableTaskTracker::TaskId CancelableTaskTracker::NewTrackedTaskId(
IsCanceledCallback* is_canceled_cb) {
DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK(base::MessageLoopProxy::current().get());
+ DCHECK(base::ThreadTaskRunnerHandle::IsSet());
TaskId id = next_id_;
next_id_++; // int64 is big enough that we ignore the potential overflow.
@@ -129,7 +130,7 @@ CancelableTaskTracker::TaskId CancelableTaskTracker::NewTrackedTaskId(
// Will always run |untrack_and_delete_flag| on current MessageLoop.
base::ScopedClosureRunner* untrack_and_delete_flag_runner =
new base::ScopedClosureRunner(Bind(&RunOrPostToTaskRunner,
- base::MessageLoopProxy::current(),
+ base::ThreadTaskRunnerHandle::Get(),
untrack_and_delete_flag));
*is_canceled_cb =
« no previous file with comments | « base/synchronization/waitable_event_watcher_posix.cc ('k') | base/task/cancelable_task_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698