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

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: 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
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..f14f86839808106864f3aa598fb803c630b7e5f8 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::Get());
danakj 2015/04/21 20:16:30 Get() already DCHECKs. Do you want to IsSet()?
Sami 2015/04/23 17:48:25 Yes, that makes more sense (checked for any other
// 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::Get());
danakj 2015/04/21 20:16:30 dittos
Sami 2015/04/23 17:48:25 Done.
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 =

Powered by Google App Engine
This is Rietveld 408576698