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

Unified Diff: components/sync/engine_impl/directory_update_handler.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/directory_update_handler.cc
diff --git a/components/sync/engine_impl/directory_update_handler.cc b/components/sync/engine_impl/directory_update_handler.cc
index bfea376b6cc3a5114249af83098a0c1353dea34e..259d83e9349da7dc6c280ff747eca4ef753aca5f 100644
--- a/components/sync/engine_impl/directory_update_handler.cc
+++ b/components/sync/engine_impl/directory_update_handler.cc
@@ -8,6 +8,7 @@
#include <vector>
+#include "base/memory/ptr_util.h"
#include "components/sync/base/data_type_histogram.h"
#include "components/sync/engine_impl/conflict_resolver.h"
#include "components/sync/engine_impl/cycle/directory_type_debug_info_emitter.h"
@@ -285,8 +286,9 @@ void DirectoryUpdateHandler::ExpireEntriesIfNeeded(
sync_pb::DataTypeProgressMarker current_marker;
GetDownloadProgress(&current_marker);
if (current_marker.has_gc_directive()) {
- cached_gc_directive_.reset(new sync_pb::GarbageCollectionDirective(
- current_marker.gc_directive()));
+ cached_gc_directive_ =
+ base::MakeUnique<sync_pb::GarbageCollectionDirective>(
+ current_marker.gc_directive());
}
}
@@ -304,8 +306,8 @@ void DirectoryUpdateHandler::ExpireEntriesIfNeeded(
new_gc_directive.version_watermark());
}
- cached_gc_directive_.reset(
- new sync_pb::GarbageCollectionDirective(new_gc_directive));
+ cached_gc_directive_ =
+ base::MakeUnique<sync_pb::GarbageCollectionDirective>(new_gc_directive);
}
} // namespace syncer
« no previous file with comments | « components/sync/engine_impl/cycle/sync_cycle.cc ('k') | components/sync/engine_impl/directory_update_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698