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

Unified Diff: components/sync/engine_impl/model_type_worker_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/engine_impl/model_type_worker_unittest.cc
diff --git a/components/sync/engine_impl/model_type_worker_unittest.cc b/components/sync/engine_impl/model_type_worker_unittest.cc
index 47b5385fd90eae1c9006e2183e4f67db870dc70d..ca1cc97cd78986ca0ed4dd035bc9cc5ed6c7d575 100644
--- a/components/sync/engine_impl/model_type_worker_unittest.cc
+++ b/components/sync/engine_impl/model_type_worker_unittest.cc
@@ -185,19 +185,19 @@ class ModelTypeWorkerTest : public ::testing::Test {
std::unique_ptr<Cryptographer> cryptographer_copy;
if (cryptographer_) {
- cryptographer_copy.reset(new Cryptographer(*cryptographer_));
+ cryptographer_copy = base::MakeUnique<Cryptographer>(*cryptographer_);
}
// TODO(maxbogue): crbug.com/529498: Inject pending updates somehow.
- worker_.reset(
- new ModelTypeWorker(kModelType, state, std::move(cryptographer_copy),
- &mock_nudge_handler_, std::move(processor)));
+ worker_ = base::MakeUnique<ModelTypeWorker>(
+ kModelType, state, std::move(cryptographer_copy), &mock_nudge_handler_,
+ std::move(processor));
}
// Introduce a new key that the local cryptographer can't decrypt.
void NewForeignEncryptionKey() {
if (!cryptographer_) {
- cryptographer_.reset(new Cryptographer(&fake_encryptor_));
+ cryptographer_ = base::MakeUnique<Cryptographer>(&fake_encryptor_);
}
foreign_encryption_key_index_++;
@@ -244,7 +244,7 @@ class ModelTypeWorkerTest : public ::testing::Test {
// Update the local cryptographer with all relevant keys.
void UpdateLocalCryptographer() {
if (!cryptographer_) {
- cryptographer_.reset(new Cryptographer(&fake_encryptor_));
+ cryptographer_ = base::MakeUnique<Cryptographer>(&fake_encryptor_);
}
KeyParams params = GetNthKeyParams(foreign_encryption_key_index_);

Powered by Google App Engine
This is Rietveld 408576698