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

Unified Diff: components/sync/model_impl/attachments/attachment_service_impl_unittest.cc

Issue 2422253002: [Sync] Rewriting ".reset(new" pattern to use "= base::MakeUnique" instead. (Closed)
Patch Set: Fixing compile. Created 4 years, 2 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: components/sync/model_impl/attachments/attachment_service_impl_unittest.cc
diff --git a/components/sync/model_impl/attachments/attachment_service_impl_unittest.cc b/components/sync/model_impl/attachments/attachment_service_impl_unittest.cc
index c4cc471a68832c82dab650f21348f3033ada572c..446a6a9865590ef45b5172be2229d6f543490ad3 100644
--- a/components/sync/model_impl/attachments/attachment_service_impl_unittest.cc
+++ b/components/sync/model_impl/attachments/attachment_service_impl_unittest.cc
@@ -149,7 +149,8 @@ class MockAttachmentDownloader
std::unique_ptr<Attachment> attachment;
if (result == DOWNLOAD_SUCCESS) {
scoped_refptr<base::RefCountedString> data = new base::RefCountedString();
- attachment.reset(new Attachment(Attachment::CreateFromParts(id, data)));
+ attachment =
+ base::MakeUnique<Attachment>(Attachment::CreateFromParts(id, data));
}
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
@@ -238,10 +239,10 @@ class AttachmentServiceImplTest : public testing::Test,
if (downloader.get()) {
attachment_downloader_ = downloader->AsWeakPtr();
}
- attachment_service_.reset(new AttachmentServiceImpl(
+ attachment_service_ = base::MakeUnique<AttachmentServiceImpl>(
attachment_store->CreateAttachmentStoreForSync(), std::move(uploader),
std::move(downloader), delegate, base::TimeDelta::FromMinutes(1),
- base::TimeDelta::FromMinutes(8)));
+ base::TimeDelta::FromMinutes(8));
std::unique_ptr<base::MockTimer> timer_to_pass(
new base::MockTimer(false, false));
« no previous file with comments | « components/sync/model_impl/attachments/attachment_service_impl.cc ('k') | components/sync/model_impl/attachments/task_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698