summaryrefslogtreecommitdiffstats
path: root/sync
diff options
context:
space:
mode:
authorpavely@chromium.org <pavely@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-13 22:01:19 +0000
committerpavely@chromium.org <pavely@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-13 22:01:19 +0000
commite75fb7a76f9fa2af777afa67f777b23d503be29d (patch)
tree32636f35a36a8570cdca970e1c6340683036bac2 /sync
parenta509ba9a847a208bab1e7e60a781818dbb351554 (diff)
downloadchromium_src-e75fb7a76f9fa2af777afa67f777b23d503be29d.zip
chromium_src-e75fb7a76f9fa2af777afa67f777b23d503be29d.tar.gz
chromium_src-e75fb7a76f9fa2af777afa67f777b23d503be29d.tar.bz2
Rename FakeAttachmentService to AttachmentServiceImpl
No functionality change whatsoever. BUG=356359 Review URL: https://codereview.chromium.org/279263003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270220 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync')
-rw-r--r--sync/api/attachments/attachment_service_impl.cc (renamed from sync/api/attachments/fake_attachment_service.cc)32
-rw-r--r--sync/api/attachments/attachment_service_impl.h (renamed from sync/api/attachments/fake_attachment_service.h)20
-rw-r--r--sync/api/attachments/attachment_service_proxy_for_test.cc4
-rw-r--r--sync/api/sync_data_unittest.cc4
-rw-r--r--sync/sync_api.gypi4
5 files changed, 32 insertions, 32 deletions
diff --git a/sync/api/attachments/fake_attachment_service.cc b/sync/api/attachments/attachment_service_impl.cc
index 922fa7b..7557887 100644
--- a/sync/api/attachments/fake_attachment_service.cc
+++ b/sync/api/attachments/attachment_service_impl.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "sync/api/attachments/fake_attachment_service.h"
+#include "sync/api/attachments/attachment_service_impl.h"
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
@@ -12,7 +12,7 @@
namespace syncer {
-FakeAttachmentService::FakeAttachmentService(
+AttachmentServiceImpl::AttachmentServiceImpl(
scoped_ptr<AttachmentStore> attachment_store,
scoped_ptr<AttachmentUploader> attachment_uploader)
: attachment_store_(attachment_store.Pass()),
@@ -23,61 +23,61 @@ FakeAttachmentService::FakeAttachmentService(
DCHECK(attachment_uploader_);
}
-FakeAttachmentService::~FakeAttachmentService() {
+AttachmentServiceImpl::~AttachmentServiceImpl() {
DCHECK(CalledOnValidThread());
}
// Static.
-scoped_ptr<syncer::AttachmentService> FakeAttachmentService::CreateForTest() {
+scoped_ptr<syncer::AttachmentService> AttachmentServiceImpl::CreateForTest() {
scoped_ptr<syncer::AttachmentStore> attachment_store(
new syncer::FakeAttachmentStore(base::MessageLoopProxy::current()));
scoped_ptr<AttachmentUploader> attachment_uploader(
new FakeAttachmentUploader);
scoped_ptr<syncer::AttachmentService> attachment_service(
- new syncer::FakeAttachmentService(attachment_store.Pass(),
+ new syncer::AttachmentServiceImpl(attachment_store.Pass(),
attachment_uploader.Pass()));
return attachment_service.Pass();
}
-void FakeAttachmentService::GetOrDownloadAttachments(
+void AttachmentServiceImpl::GetOrDownloadAttachments(
const AttachmentIdList& attachment_ids,
const GetOrDownloadCallback& callback) {
DCHECK(CalledOnValidThread());
attachment_store_->Read(attachment_ids,
- base::Bind(&FakeAttachmentService::ReadDone,
+ base::Bind(&AttachmentServiceImpl::ReadDone,
weak_ptr_factory_.GetWeakPtr(),
callback));
}
-void FakeAttachmentService::DropAttachments(
+void AttachmentServiceImpl::DropAttachments(
const AttachmentIdList& attachment_ids,
const DropCallback& callback) {
DCHECK(CalledOnValidThread());
attachment_store_->Drop(attachment_ids,
- base::Bind(&FakeAttachmentService::DropDone,
+ base::Bind(&AttachmentServiceImpl::DropDone,
weak_ptr_factory_.GetWeakPtr(),
callback));
}
-void FakeAttachmentService::StoreAttachments(const AttachmentList& attachments,
+void AttachmentServiceImpl::StoreAttachments(const AttachmentList& attachments,
const StoreCallback& callback) {
DCHECK(CalledOnValidThread());
attachment_store_->Write(attachments,
- base::Bind(&FakeAttachmentService::WriteDone,
+ base::Bind(&AttachmentServiceImpl::WriteDone,
weak_ptr_factory_.GetWeakPtr(),
callback));
// TODO(maniscalco): Ensure the linked attachments are schedule for upload to
// the server (bug 356351).
}
-void FakeAttachmentService::OnSyncDataDelete(const SyncData& sync_data) {
+void AttachmentServiceImpl::OnSyncDataDelete(const SyncData& sync_data) {
DCHECK(CalledOnValidThread());
// TODO(maniscalco): One or more of sync_data's attachments may no longer be
// referenced anywhere. We should probably delete them at this point (bug
// 356351).
}
-void FakeAttachmentService::OnSyncDataUpdate(
+void AttachmentServiceImpl::OnSyncDataUpdate(
const AttachmentIdList& old_attachment_ids,
const SyncData& updated_sync_data) {
DCHECK(CalledOnValidThread());
@@ -87,7 +87,7 @@ void FakeAttachmentService::OnSyncDataUpdate(
// attachments from local storage (bug 356351).
}
-void FakeAttachmentService::ReadDone(const GetOrDownloadCallback& callback,
+void AttachmentServiceImpl::ReadDone(const GetOrDownloadCallback& callback,
const AttachmentStore::Result& result,
scoped_ptr<AttachmentMap> attachments) {
AttachmentService::GetOrDownloadResult get_result =
@@ -100,7 +100,7 @@ void FakeAttachmentService::ReadDone(const GetOrDownloadCallback& callback,
FROM_HERE, base::Bind(callback, get_result, base::Passed(&attachments)));
}
-void FakeAttachmentService::DropDone(const DropCallback& callback,
+void AttachmentServiceImpl::DropDone(const DropCallback& callback,
const AttachmentStore::Result& result) {
AttachmentService::DropResult drop_result =
AttachmentService::DROP_UNSPECIFIED_ERROR;
@@ -112,7 +112,7 @@ void FakeAttachmentService::DropDone(const DropCallback& callback,
base::Bind(callback, drop_result));
}
-void FakeAttachmentService::WriteDone(const StoreCallback& callback,
+void AttachmentServiceImpl::WriteDone(const StoreCallback& callback,
const AttachmentStore::Result& result) {
AttachmentService::StoreResult store_result =
AttachmentService::STORE_UNSPECIFIED_ERROR;
diff --git a/sync/api/attachments/fake_attachment_service.h b/sync/api/attachments/attachment_service_impl.h
index 8159e0f..f833b6f 100644
--- a/sync/api/attachments/fake_attachment_service.h
+++ b/sync/api/attachments/attachment_service_impl.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef SYNC_API_ATTACHMENTS_FAKE_ATTACHMENT_SERVICE_H_
-#define SYNC_API_ATTACHMENTS_FAKE_ATTACHMENT_SERVICE_H_
+#ifndef SYNC_API_ATTACHMENTS_ATTACHMENT_SERVICE_IMPL_H_
+#define SYNC_API_ATTACHMENTS_ATTACHMENT_SERVICE_IMPL_H_
#include "base/memory/weak_ptr.h"
#include "base/threading/non_thread_safe.h"
@@ -14,15 +14,15 @@
namespace syncer {
-// A fake implementation of AttachmentService.
-class SYNC_EXPORT FakeAttachmentService : public AttachmentService,
+// Implementation of AttachmentService.
+class SYNC_EXPORT AttachmentServiceImpl : public AttachmentService,
public base::NonThreadSafe {
public:
- FakeAttachmentService(scoped_ptr<AttachmentStore> attachment_store,
+ AttachmentServiceImpl(scoped_ptr<AttachmentStore> attachment_store,
scoped_ptr<AttachmentUploader> attachment_uploader);
- virtual ~FakeAttachmentService();
+ virtual ~AttachmentServiceImpl();
- // Create a FakeAttachmentService suitable for use in tests.
+ // Create an AttachmentServiceImpl suitable for use in tests.
static scoped_ptr<syncer::AttachmentService> CreateForTest();
// AttachmentService implementation.
@@ -49,11 +49,11 @@ class SYNC_EXPORT FakeAttachmentService : public AttachmentService,
const scoped_ptr<AttachmentStore> attachment_store_;
const scoped_ptr<AttachmentUploader> attachment_uploader_;
// Must be last data member.
- base::WeakPtrFactory<FakeAttachmentService> weak_ptr_factory_;
+ base::WeakPtrFactory<AttachmentServiceImpl> weak_ptr_factory_;
- DISALLOW_COPY_AND_ASSIGN(FakeAttachmentService);
+ DISALLOW_COPY_AND_ASSIGN(AttachmentServiceImpl);
};
} // namespace syncer
-#endif // SYNC_API_ATTACHMENTS_FAKE_ATTACHMENT_SERVICE_H_
+#endif // SYNC_API_ATTACHMENTS_ATTACHMENT_SERVICE_IMPL_H_
diff --git a/sync/api/attachments/attachment_service_proxy_for_test.cc b/sync/api/attachments/attachment_service_proxy_for_test.cc
index 7d03ed8..625eb7c 100644
--- a/sync/api/attachments/attachment_service_proxy_for_test.cc
+++ b/sync/api/attachments/attachment_service_proxy_for_test.cc
@@ -6,7 +6,7 @@
#include "base/message_loop/message_loop.h"
#include "base/message_loop/message_loop_proxy.h"
-#include "sync/api/attachments/fake_attachment_service.h"
+#include "sync/api/attachments/attachment_service_impl.h"
namespace syncer {
@@ -24,7 +24,7 @@ AttachmentServiceProxyForTest::OwningCore::~OwningCore() {
// Static.
AttachmentServiceProxy AttachmentServiceProxyForTest::Create() {
- scoped_ptr<AttachmentService> wrapped(FakeAttachmentService::CreateForTest());
+ scoped_ptr<AttachmentService> wrapped(AttachmentServiceImpl::CreateForTest());
// This class's base class, AttachmentServiceProxy, must be initialized with a
// WeakPtr to an AttachmentService. Because the base class ctor must be
// invoked before any of this class's members are initialized, we create the
diff --git a/sync/api/sync_data_unittest.cc b/sync/api/sync_data_unittest.cc
index 4eab286..fb305de 100644
--- a/sync/api/sync_data_unittest.cc
+++ b/sync/api/sync_data_unittest.cc
@@ -12,8 +12,8 @@
#include "base/time/time.h"
#include "sync/api/attachments/attachment_id.h"
#include "sync/api/attachments/attachment_service.h"
+#include "sync/api/attachments/attachment_service_impl.h"
#include "sync/api/attachments/attachment_service_proxy.h"
-#include "sync/api/attachments/fake_attachment_service.h"
#include "sync/protocol/sync.pb.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -32,7 +32,7 @@ const base::Time kLastModifiedTime = base::Time();
class SyncDataTest : public testing::Test {
protected:
SyncDataTest()
- : attachment_service(FakeAttachmentService::CreateForTest()),
+ : attachment_service(AttachmentServiceImpl::CreateForTest()),
attachment_service_weak_ptr_factory(attachment_service.get()),
attachment_service_proxy(
base::MessageLoopProxy::current(),
diff --git a/sync/sync_api.gypi b/sync/sync_api.gypi
index ec3bc7f..e8be167 100644
--- a/sync/sync_api.gypi
+++ b/sync/sync_api.gypi
@@ -19,6 +19,8 @@
'api/attachments/attachment_id.h',
'api/attachments/attachment_service.cc',
'api/attachments/attachment_service.h',
+ 'api/attachments/attachment_service_impl.cc',
+ 'api/attachments/attachment_service_impl.h',
'api/attachments/attachment_service_proxy.cc',
'api/attachments/attachment_service_proxy.h',
'api/attachments/attachment_service_proxy_for_test.cc',
@@ -27,8 +29,6 @@
'api/attachments/attachment_store.h',
'api/attachments/attachment_uploader.cc',
'api/attachments/attachment_uploader.h',
- 'api/attachments/fake_attachment_service.cc',
- 'api/attachments/fake_attachment_service.h',
'api/string_ordinal.h',
'api/syncable_service.cc',
'api/syncable_service.h',