From 171cdbe57a05e46d1e6a304f90eb2821a6e427bd Mon Sep 17 00:00:00 2001 From: "anujk.sharma" Date: Wed, 29 Apr 2015 23:51:54 -0700 Subject: Replace MessageLoopProxy usage with ThreadTaskRunnerHandle in sync module. MessageLoopProxy is deprecated. This basically does a search and replace: MessageLoopProxy::current() -> ThreadTaskRunnerHandle::Get(). BUG=391045 Review URL: https://codereview.chromium.org/1110063004 Cr-Commit-Position: refs/heads/master@{#327662} --- sync/internal_api/public/util/weak_handle.cc | 8 ++++---- sync/internal_api/public/util/weak_handle.h | 7 ++----- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'sync/internal_api') diff --git a/sync/internal_api/public/util/weak_handle.cc b/sync/internal_api/public/util/weak_handle.cc index 0ed142e..e0864ed 100644 --- a/sync/internal_api/public/util/weak_handle.cc +++ b/sync/internal_api/public/util/weak_handle.cc @@ -8,17 +8,17 @@ #include "base/callback.h" #include "base/location.h" -#include "base/message_loop/message_loop_proxy.h" +#include "base/thread_task_runner_handle.h" namespace syncer { namespace internal { WeakHandleCoreBase::WeakHandleCoreBase() - : owner_loop_proxy_(base::MessageLoopProxy::current()) {} + : owner_loop_task_runner_(base::ThreadTaskRunnerHandle::Get()) {} bool WeakHandleCoreBase::IsOnOwnerThread() const { - return owner_loop_proxy_->BelongsToCurrentThread(); + return owner_loop_task_runner_->BelongsToCurrentThread(); } WeakHandleCoreBase::~WeakHandleCoreBase() {} @@ -26,7 +26,7 @@ WeakHandleCoreBase::~WeakHandleCoreBase() {} void WeakHandleCoreBase::PostToOwnerThread( const tracked_objects::Location& from_here, const base::Closure& fn) const { - if (!owner_loop_proxy_->PostTask(from_here, fn)) { + if (!owner_loop_task_runner_->PostTask(from_here, fn)) { DVLOG(1) << "Could not post task from " << from_here.ToString(); } } diff --git a/sync/internal_api/public/util/weak_handle.h b/sync/internal_api/public/util/weak_handle.h index c299be7..7a11a15 100644 --- a/sync/internal_api/public/util/weak_handle.h +++ b/sync/internal_api/public/util/weak_handle.h @@ -58,12 +58,9 @@ #include "base/logging.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" +#include "base/single_thread_task_runner.h" #include "sync/base/sync_export.h" -namespace base { -class MessageLoopProxy; -} // namespace base - namespace tracked_objects { class Location; } // namespace tracked_objects @@ -118,7 +115,7 @@ class SYNC_EXPORT WeakHandleCoreBase { private: // May be used on any thread. - const scoped_refptr owner_loop_proxy_; + const scoped_refptr owner_loop_task_runner_; DISALLOW_COPY_AND_ASSIGN(WeakHandleCoreBase); }; -- cgit v1.1