From ee301a9906e35092f5c199e669e46e63c866ed5e Mon Sep 17 00:00:00 2001 From: "maniscalco@chromium.org" Date: Wed, 9 Jul 2014 21:28:09 +0000 Subject: Replace MessageLoopProxy with ThreadTaskRunnerHandle in src/sync/. MessageLoopProxy is deprecated. BUG=391045 Review URL: https://codereview.chromium.org/375403002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282129 0039d316-1c4b-4281-b951-d872f2087c98 --- sync/api/attachments/attachment_service_impl.cc | 3 ++- sync/api/attachments/attachment_service_proxy.cc | 11 +++++++---- sync/api/attachments/attachment_service_proxy_for_test.cc | 4 ++-- sync/api/sync_data_unittest.cc | 4 ++-- 4 files changed, 13 insertions(+), 9 deletions(-) (limited to 'sync/api') diff --git a/sync/api/attachments/attachment_service_impl.cc b/sync/api/attachments/attachment_service_impl.cc index 2e39780..07c2f75 100644 --- a/sync/api/attachments/attachment_service_impl.cc +++ b/sync/api/attachments/attachment_service_impl.cc @@ -6,6 +6,7 @@ #include "base/bind.h" #include "base/message_loop/message_loop.h" +#include "base/thread_task_runner_handle.h" #include "sync/api/attachments/attachment.h" #include "sync/internal_api/public/attachments/fake_attachment_downloader.h" #include "sync/internal_api/public/attachments/fake_attachment_store.h" @@ -127,7 +128,7 @@ AttachmentServiceImpl::~AttachmentServiceImpl() { // Static. scoped_ptr AttachmentServiceImpl::CreateForTest() { scoped_ptr attachment_store( - new syncer::FakeAttachmentStore(base::MessageLoopProxy::current())); + new syncer::FakeAttachmentStore(base::ThreadTaskRunnerHandle::Get())); scoped_ptr attachment_uploader( new FakeAttachmentUploader); scoped_ptr attachment_downloader( diff --git a/sync/api/attachments/attachment_service_proxy.cc b/sync/api/attachments/attachment_service_proxy.cc index 2477140..4b9bc67 100644 --- a/sync/api/attachments/attachment_service_proxy.cc +++ b/sync/api/attachments/attachment_service_proxy.cc @@ -6,6 +6,7 @@ #include "base/bind.h" #include "base/message_loop/message_loop.h" +#include "base/thread_task_runner_handle.h" #include "sync/api/sync_data.h" namespace syncer { @@ -71,8 +72,10 @@ void AttachmentServiceProxy::GetOrDownloadAttachments( const AttachmentIdList& attachment_ids, const GetOrDownloadCallback& callback) { DCHECK(wrapped_task_runner_); - GetOrDownloadCallback proxy_callback = base::Bind( - &ProxyGetOrDownloadCallback, base::MessageLoopProxy::current(), callback); + GetOrDownloadCallback proxy_callback = + base::Bind(&ProxyGetOrDownloadCallback, + base::ThreadTaskRunnerHandle::Get(), + callback); wrapped_task_runner_->PostTask( FROM_HERE, base::Bind(&AttachmentService::GetOrDownloadAttachments, @@ -86,7 +89,7 @@ void AttachmentServiceProxy::DropAttachments( const DropCallback& callback) { DCHECK(wrapped_task_runner_); DropCallback proxy_callback = base::Bind( - &ProxyDropCallback, base::MessageLoopProxy::current(), callback); + &ProxyDropCallback, base::ThreadTaskRunnerHandle::Get(), callback); wrapped_task_runner_->PostTask(FROM_HERE, base::Bind(&AttachmentService::DropAttachments, core_, @@ -98,7 +101,7 @@ void AttachmentServiceProxy::StoreAttachments(const AttachmentList& attachments, const StoreCallback& callback) { DCHECK(wrapped_task_runner_); StoreCallback proxy_callback = base::Bind( - &ProxyStoreCallback, base::MessageLoopProxy::current(), callback); + &ProxyStoreCallback, base::ThreadTaskRunnerHandle::Get(), callback); wrapped_task_runner_->PostTask( FROM_HERE, base::Bind(&AttachmentService::StoreAttachments, diff --git a/sync/api/attachments/attachment_service_proxy_for_test.cc b/sync/api/attachments/attachment_service_proxy_for_test.cc index 625eb7c..bc59ba7 100644 --- a/sync/api/attachments/attachment_service_proxy_for_test.cc +++ b/sync/api/attachments/attachment_service_proxy_for_test.cc @@ -5,7 +5,7 @@ #include "sync/api/attachments/attachment_service_proxy_for_test.h" #include "base/message_loop/message_loop.h" -#include "base/message_loop/message_loop_proxy.h" +#include "base/thread_task_runner_handle.h" #include "sync/api/attachments/attachment_service_impl.h" namespace syncer { @@ -39,7 +39,7 @@ AttachmentServiceProxy AttachmentServiceProxyForTest::Create() { new OwningCore(wrapped.Pass(), weak_ptr_factory.Pass())); scoped_refptr runner( - base::MessageLoopProxy::current()); + base::ThreadTaskRunnerHandle::Get()); if (!runner) { // Dummy runner for tests that don't care about AttachmentServiceProxy. DVLOG(1) << "Creating dummy MessageLoop for AttachmentServiceProxy."; diff --git a/sync/api/sync_data_unittest.cc b/sync/api/sync_data_unittest.cc index fb305de..aa34b0e 100644 --- a/sync/api/sync_data_unittest.cc +++ b/sync/api/sync_data_unittest.cc @@ -8,7 +8,7 @@ #include "base/memory/ref_counted_memory.h" #include "base/message_loop/message_loop.h" -#include "base/message_loop/message_loop_proxy.h" +#include "base/thread_task_runner_handle.h" #include "base/time/time.h" #include "sync/api/attachments/attachment_id.h" #include "sync/api/attachments/attachment_service.h" @@ -35,7 +35,7 @@ class SyncDataTest : public testing::Test { : attachment_service(AttachmentServiceImpl::CreateForTest()), attachment_service_weak_ptr_factory(attachment_service.get()), attachment_service_proxy( - base::MessageLoopProxy::current(), + base::ThreadTaskRunnerHandle::Get(), attachment_service_weak_ptr_factory.GetWeakPtr()) {} base::MessageLoop loop; sync_pb::EntitySpecifics specifics; -- cgit v1.1