summaryrefslogtreecommitdiffstats
path: root/sync/api
diff options
context:
space:
mode:
authormaniscalco@chromium.org <maniscalco@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-09 21:28:09 +0000
committermaniscalco@chromium.org <maniscalco@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-09 21:28:09 +0000
commitee301a9906e35092f5c199e669e46e63c866ed5e (patch)
tree108808fd01bcb0b07463e6abb8254837851e4a4f /sync/api
parente59bbf24d251334c0d744f7ee4dfdf4113c3cb83 (diff)
downloadchromium_src-ee301a9906e35092f5c199e669e46e63c866ed5e.zip
chromium_src-ee301a9906e35092f5c199e669e46e63c866ed5e.tar.gz
chromium_src-ee301a9906e35092f5c199e669e46e63c866ed5e.tar.bz2
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
Diffstat (limited to 'sync/api')
-rw-r--r--sync/api/attachments/attachment_service_impl.cc3
-rw-r--r--sync/api/attachments/attachment_service_proxy.cc11
-rw-r--r--sync/api/attachments/attachment_service_proxy_for_test.cc4
-rw-r--r--sync/api/sync_data_unittest.cc4
4 files changed, 13 insertions, 9 deletions
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<syncer::AttachmentService> AttachmentServiceImpl::CreateForTest() {
scoped_ptr<syncer::AttachmentStore> attachment_store(
- new syncer::FakeAttachmentStore(base::MessageLoopProxy::current()));
+ new syncer::FakeAttachmentStore(base::ThreadTaskRunnerHandle::Get()));
scoped_ptr<AttachmentUploader> attachment_uploader(
new FakeAttachmentUploader);
scoped_ptr<AttachmentDownloader> 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<base::SequencedTaskRunner> 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;