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

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: Rebase. Changes after feedback. 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 1b642e628c70007f88269b0df38fe4f203db8eb7..61480330e2b95076487162757028cabea6b2bb3c 100644
--- a/sync/internal_api/attachments/attachment_service_impl_unittest.cc
+++ b/sync/internal_api/attachments/attachment_service_impl_unittest.cc
@@ -84,6 +84,9 @@ class MockAttachmentStore : public AttachmentStore,
std::vector<AttachmentList> write_attachments;
std::vector<WriteCallback> write_callbacks;
+ private:
+ virtual ~MockAttachmentStore() {}
+
DISALLOW_COPY_AND_ASSIGN(MockAttachmentStore);
};
@@ -174,7 +177,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()) {
@@ -184,7 +188,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