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

Unified Diff: base/task/cancelable_task_tracker.cc

Issue 1113953002: Revert of base: Remove use 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
« 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 a2e4799f43854485f9d077c27155683ab66ccf47..b6e4b6ac4dedfd80d546deca1fe3798a7106cfc9 100644
--- a/base/task/cancelable_task_tracker.cc
+++ b/base/task/cancelable_task_tracker.cc
@@ -11,10 +11,9 @@
#include "base/compiler_specific.h"
#include "base/location.h"
#include "base/memory/ref_counted.h"
-#include "base/single_thread_task_runner.h"
+#include "base/message_loop/message_loop_proxy.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;
@@ -86,7 +85,7 @@
DCHECK(thread_checker_.CalledOnValidThread());
// We need a MessageLoop to run reply.
- DCHECK(base::ThreadTaskRunnerHandle::IsSet());
+ DCHECK(base::MessageLoopProxy::current().get());
// Owned by reply callback below.
CancellationFlag* flag = new CancellationFlag();
@@ -114,7 +113,7 @@
CancelableTaskTracker::TaskId CancelableTaskTracker::NewTrackedTaskId(
IsCanceledCallback* is_canceled_cb) {
DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK(base::ThreadTaskRunnerHandle::IsSet());
+ DCHECK(base::MessageLoopProxy::current().get());
TaskId id = next_id_;
next_id_++; // int64 is big enough that we ignore the potential overflow.
@@ -130,7 +129,7 @@
// Will always run |untrack_and_delete_flag| on current MessageLoop.
base::ScopedClosureRunner* untrack_and_delete_flag_runner =
new base::ScopedClosureRunner(Bind(&RunOrPostToTaskRunner,
- base::ThreadTaskRunnerHandle::Get(),
+ base::MessageLoopProxy::current(),
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