Chromium Code Reviews| 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 cc04408ef332c76f8afcb8b3e9ec11a8e7711ba9..370e50688fb5cae6988b02fc04aa8dc3d1bb4254 100644 |
| --- a/sync/internal_api/attachments/attachment_service_impl.cc |
| +++ b/sync/internal_api/attachments/attachment_service_impl.cc |
| @@ -11,6 +11,7 @@ |
| #include "base/thread_task_runner_handle.h" |
| #include "base/time/time.h" |
| #include "sync/api/attachments/attachment.h" |
| +#include "sync/internal_api/public/attachments/attachment_store_frontend.h" |
|
maniscalco
2015/03/06 23:15:03
Maybe I overlooked something, but is this include
pavely
2015/03/09 18:09:29
Done.
|
| #include "sync/internal_api/public/attachments/fake_attachment_downloader.h" |
| #include "sync/internal_api/public/attachments/fake_attachment_uploader.h" |
| @@ -110,13 +111,13 @@ AttachmentServiceImpl::GetOrDownloadState::PostResultIfAllRequestsCompleted() { |
| } |
| AttachmentServiceImpl::AttachmentServiceImpl( |
| - scoped_refptr<AttachmentStore> attachment_store, |
| + scoped_ptr<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), |
| + : attachment_store_(attachment_store.Pass()), |
| attachment_uploader_(attachment_uploader.Pass()), |
| attachment_downloader_(attachment_downloader.Pass()), |
| delegate_(delegate), |
| @@ -144,14 +145,14 @@ AttachmentServiceImpl::~AttachmentServiceImpl() { |
| // Static. |
| scoped_ptr<syncer::AttachmentService> AttachmentServiceImpl::CreateForTest() { |
| - scoped_refptr<syncer::AttachmentStore> attachment_store = |
| + scoped_ptr<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, |
| + new syncer::AttachmentServiceImpl(attachment_store.Pass(), |
| attachment_uploader.Pass(), |
| attachment_downloader.Pass(), |
| NULL, |
| @@ -160,10 +161,6 @@ scoped_ptr<syncer::AttachmentService> AttachmentServiceImpl::CreateForTest() { |
| return attachment_service.Pass(); |
| } |
| -AttachmentStore* AttachmentServiceImpl::GetStore() { |
| - return attachment_store_.get(); |
| -} |
| - |
| void AttachmentServiceImpl::GetOrDownloadAttachments( |
| const AttachmentIdList& attachment_ids, |
| const GetOrDownloadCallback& callback) { |
| @@ -172,8 +169,7 @@ void AttachmentServiceImpl::GetOrDownloadAttachments( |
| 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( |