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

Unified Diff: sync/internal_api/attachments/attachment_service_impl_unittest.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_unittest.cc
diff --git a/sync/internal_api/attachments/attachment_service_impl_unittest.cc b/sync/internal_api/attachments/attachment_service_impl_unittest.cc
index d8bf6b20dd5616c2f27b8ac09d0462237f19dced..3bc67facf35d0dda80d282e8de3b560b8ecea380 100644
--- a/sync/internal_api/attachments/attachment_service_impl_unittest.cc
+++ b/sync/internal_api/attachments/attachment_service_impl_unittest.cc
@@ -83,6 +83,9 @@ class MockAttachmentStore : public AttachmentStore,
std::vector<AttachmentList> write_attachments;
std::vector<WriteCallback> write_callbacks;
+ private:
+ virtual ~MockAttachmentStore() {}
+
DISALLOW_COPY_AND_ASSIGN(MockAttachmentStore);
};
@@ -173,7 +176,8 @@ class AttachmentServiceImplTest : public testing::Test,
scoped_ptr<MockAttachmentUploader> uploader,
scoped_ptr<MockAttachmentDownloader> downloader,
AttachmentService::Delegate* delegate) {
- scoped_ptr<MockAttachmentStore> attachment_store(new MockAttachmentStore());
+ scoped_refptr<MockAttachmentStore> attachment_store(
+ new MockAttachmentStore());
attachment_store_ = attachment_store->AsWeakPtr();
if (uploader.get()) {
@@ -183,7 +187,7 @@ class AttachmentServiceImplTest : public testing::Test,
attachment_downloader_ = downloader->AsWeakPtr();
}
attachment_service_.reset(
- new AttachmentServiceImpl(attachment_store.PassAs<AttachmentStore>(),
+ new AttachmentServiceImpl(attachment_store,
uploader.PassAs<AttachmentUploader>(),
downloader.PassAs<AttachmentDownloader>(),
delegate));

Powered by Google App Engine
This is Rietveld 408576698