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

Unified Diff: components/sync/engine_impl/attachments/attachment_downloader_impl.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_impl/attachments/attachment_downloader_impl.cc
diff --git a/components/sync/engine_impl/attachments/attachment_downloader_impl.cc b/components/sync/engine_impl/attachments/attachment_downloader_impl.cc
index 2135d6b20291fdee8b03849735d49173ad5d71a2..7835c2fe1add8e28e95e3bedcc39f0ec6b81a434 100644
--- a/components/sync/engine_impl/attachments/attachment_downloader_impl.cc
+++ b/components/sync/engine_impl/attachments/attachment_downloader_impl.cc
@@ -9,6 +9,7 @@
#include "base/base64.h"
#include "base/bind.h"
#include "base/location.h"
+#include "base/memory/ptr_util.h"
#include "base/metrics/histogram.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/sparse_histogram.h"
@@ -239,8 +240,8 @@ void AttachmentDownloaderImpl::ReportResult(
iter != download_state.user_callbacks.end(); ++iter) {
std::unique_ptr<Attachment> attachment;
if (result == DOWNLOAD_SUCCESS) {
- attachment.reset(new Attachment(Attachment::CreateFromParts(
- download_state.attachment_id, attachment_data)));
+ attachment = base::MakeUnique<Attachment>(Attachment::CreateFromParts(
+ download_state.attachment_id, attachment_data));
}
base::ThreadTaskRunnerHandle::Get()->PostTask(

Powered by Google App Engine
This is Rietveld 408576698