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

Unified Diff: components/sync/engine/attachments/fake_attachment_downloader.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/engine/attachments/fake_attachment_downloader.cc
diff --git a/components/sync/engine/attachments/fake_attachment_downloader.cc b/components/sync/engine/attachments/fake_attachment_downloader.cc
index a043c670937abc07268e08ae4b75c38fadaaf660..66f85fb7baadb19870e41fe9682fef76bf410976 100644
--- a/components/sync/engine/attachments/fake_attachment_downloader.cc
+++ b/components/sync/engine/attachments/fake_attachment_downloader.cc
@@ -4,8 +4,11 @@
#include "components/sync/engine/attachments/fake_attachment_downloader.h"
+#include <memory>
+
#include "base/bind.h"
#include "base/location.h"
+#include "base/memory/ptr_util.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "components/sync/engine/attachments/attachment_util.h"
@@ -25,9 +28,8 @@ void FakeAttachmentDownloader::DownloadAttachment(
// This is happy fake downloader, it always successfully downloads empty
// attachment.
scoped_refptr<base::RefCountedMemory> data(new base::RefCountedBytes());
- std::unique_ptr<Attachment> attachment;
- attachment.reset(
- new Attachment(Attachment::CreateFromParts(attachment_id, data)));
+ std::unique_ptr<Attachment> attachment = base::MakeUnique<Attachment>(
+ Attachment::CreateFromParts(attachment_id, data));
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(callback, DOWNLOAD_SUCCESS, base::Passed(&attachment)));
« no previous file with comments | « components/sync/driver/startup_controller_unittest.cc ('k') | components/sync/engine/attachments/on_disk_attachment_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698