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

Unified Diff: sync/internal_api/attachments/attachment_service_impl.cc

Issue 996473005: Revert of [Sync] Refactor AttachmentStore classes. Introduce concept of referrer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « sync/api/syncable_service.cc ('k') | sync/internal_api/attachments/attachment_service_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/attachments/attachment_service_impl.cc
diff --git a/sync/internal_api/attachments/attachment_service_impl.cc b/sync/internal_api/attachments/attachment_service_impl.cc
index e76151507fa8f99543951c3f79b9354669e34d32..cc04408ef332c76f8afcb8b3e9ec11a8e7711ba9 100644
--- a/sync/internal_api/attachments/attachment_service_impl.cc
+++ b/sync/internal_api/attachments/attachment_service_impl.cc
@@ -110,13 +110,13 @@
}
AttachmentServiceImpl::AttachmentServiceImpl(
- scoped_ptr<AttachmentStore> attachment_store,
+ scoped_refptr<AttachmentStore> attachment_store,
scoped_ptr<AttachmentUploader> attachment_uploader,
scoped_ptr<AttachmentDownloader> attachment_downloader,
Delegate* delegate,
const base::TimeDelta& initial_backoff_delay,
const base::TimeDelta& max_backoff_delay)
- : attachment_store_(attachment_store.Pass()),
+ : attachment_store_(attachment_store),
attachment_uploader_(attachment_uploader.Pass()),
attachment_downloader_(attachment_downloader.Pass()),
delegate_(delegate),
@@ -144,14 +144,14 @@
// Static.
scoped_ptr<syncer::AttachmentService> AttachmentServiceImpl::CreateForTest() {
- scoped_ptr<syncer::AttachmentStore> attachment_store =
+ scoped_refptr<syncer::AttachmentStore> attachment_store =
AttachmentStore::CreateInMemoryStore();
scoped_ptr<AttachmentUploader> attachment_uploader(
new FakeAttachmentUploader);
scoped_ptr<AttachmentDownloader> attachment_downloader(
new FakeAttachmentDownloader());
scoped_ptr<syncer::AttachmentService> attachment_service(
- new syncer::AttachmentServiceImpl(attachment_store.Pass(),
+ new syncer::AttachmentServiceImpl(attachment_store,
attachment_uploader.Pass(),
attachment_downloader.Pass(),
NULL,
@@ -160,6 +160,10 @@
return attachment_service.Pass();
}
+AttachmentStore* AttachmentServiceImpl::GetStore() {
+ return attachment_store_.get();
+}
+
void AttachmentServiceImpl::GetOrDownloadAttachments(
const AttachmentIdList& attachment_ids,
const GetOrDownloadCallback& callback) {
@@ -168,7 +172,8 @@
new GetOrDownloadState(attachment_ids, callback));
attachment_store_->Read(attachment_ids,
base::Bind(&AttachmentServiceImpl::ReadDone,
- weak_ptr_factory_.GetWeakPtr(), state));
+ weak_ptr_factory_.GetWeakPtr(),
+ state));
}
void AttachmentServiceImpl::ReadDone(
« no previous file with comments | « sync/api/syncable_service.cc ('k') | sync/internal_api/attachments/attachment_service_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698