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

Unified Diff: components/sync/engine_impl/model_type_registry.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/model_type_registry.cc
diff --git a/components/sync/engine_impl/model_type_registry.cc b/components/sync/engine_impl/model_type_registry.cc
index 9854d5b3d4479eb316b9a8b84a963620ccd96c1b..4517cb0eb5fa693a75d39b13a5304cd1a72a0243 100644
--- a/components/sync/engine_impl/model_type_registry.cc
+++ b/components/sync/engine_impl/model_type_registry.cc
@@ -146,7 +146,7 @@ void ModelTypeRegistry::ConnectType(
std::unique_ptr<Cryptographer> cryptographer_copy;
if (encrypted_types_.Has(type))
- cryptographer_copy.reset(new Cryptographer(*cryptographer_));
+ cryptographer_copy = base::MakeUnique<Cryptographer>(*cryptographer_);
std::unique_ptr<ModelTypeWorker> worker(new ModelTypeWorker(
type, activation_context->model_type_state, std::move(cryptographer_copy),
@@ -276,7 +276,7 @@ void ModelTypeRegistry::OnEncryptionComplete() {}
void ModelTypeRegistry::OnCryptographerStateChanged(
Cryptographer* cryptographer) {
- cryptographer_.reset(new Cryptographer(*cryptographer));
+ cryptographer_ = base::MakeUnique<Cryptographer>(*cryptographer);
OnEncryptionStateChanged();
}

Powered by Google App Engine
This is Rietveld 408576698