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

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

Issue 548373003: Move AttachmentStore ownership to datatype (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: SyncableService related changes Created 6 years, 3 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
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 61fb1c663c9af0eae41eb681d173238a8601fefd..5d9228026faf061cd63e3c4b94c515c31763c33f 100644
--- a/sync/internal_api/attachments/attachment_service_impl.cc
+++ b/sync/internal_api/attachments/attachment_service_impl.cc
@@ -108,11 +108,11 @@ AttachmentServiceImpl::GetOrDownloadState::PostResultIfAllRequestsCompleted() {
}
AttachmentServiceImpl::AttachmentServiceImpl(
- scoped_ptr<AttachmentStore> attachment_store,
+ scoped_refptr<AttachmentStore> attachment_store,
scoped_ptr<AttachmentUploader> attachment_uploader,
scoped_ptr<AttachmentDownloader> attachment_downloader,
Delegate* delegate)
- : attachment_store_(attachment_store.Pass()),
+ : attachment_store_(attachment_store),
attachment_uploader_(attachment_uploader.Pass()),
attachment_downloader_(attachment_downloader.Pass()),
delegate_(delegate),
@@ -127,14 +127,14 @@ AttachmentServiceImpl::~AttachmentServiceImpl() {
// Static.
scoped_ptr<syncer::AttachmentService> AttachmentServiceImpl::CreateForTest() {
- scoped_ptr<syncer::AttachmentStore> attachment_store(
+ scoped_refptr<syncer::AttachmentStore> attachment_store(
new syncer::FakeAttachmentStore(base::ThreadTaskRunnerHandle::Get()));
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));

Powered by Google App Engine
This is Rietveld 408576698