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

Unified Diff: components/sync/engine_impl/sync_scheduler_impl_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
« no previous file with comments | « components/sync/engine_impl/sync_scheduler_impl.cc ('k') | components/sync/engine_impl/syncer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/engine_impl/sync_scheduler_impl_unittest.cc
diff --git a/components/sync/engine_impl/sync_scheduler_impl_unittest.cc b/components/sync/engine_impl/sync_scheduler_impl_unittest.cc
index 732f90ebae091531e69ae72a57dad0bbac7bbc04..934e793e3b893d7d9d50da5ea09145bc6cb1657d 100644
--- a/components/sync/engine_impl/sync_scheduler_impl_unittest.cc
+++ b/components/sync/engine_impl/sync_scheduler_impl_unittest.cc
@@ -11,6 +11,7 @@
#include "base/bind.h"
#include "base/location.h"
+#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
#include "base/test/test_timeouts.h"
@@ -138,26 +139,26 @@ class SyncSchedulerImplTest : public testing::Test {
workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_DB)));
workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_PASSIVE)));
- connection_.reset(
- new MockConnectionManager(directory(), &cancelation_signal_));
+ connection_ = base::MakeUnique<MockConnectionManager>(directory(),
+ &cancelation_signal_);
connection_->SetServerReachable();
- model_type_registry_.reset(
- new ModelTypeRegistry(workers_, directory(), &mock_nudge_handler_));
+ model_type_registry_ = base::MakeUnique<ModelTypeRegistry>(
+ workers_, directory(), &mock_nudge_handler_);
- context_.reset(new SyncCycleContext(
+ context_ = base::MakeUnique<SyncCycleContext>(
connection_.get(), directory(), extensions_activity_.get(),
- std::vector<SyncEngineEventListener*>(), NULL,
+ std::vector<SyncEngineEventListener*>(), nullptr,
model_type_registry_.get(),
true, // enable keystore encryption
false, // force enable pre-commit GU avoidance
- "fake_invalidator_client_id"));
+ "fake_invalidator_client_id");
context_->SetRoutingInfo(routing_info_);
context_->set_notifications_enabled(true);
context_->set_account_name("Test");
- scheduler_.reset(new SyncSchedulerImpl("TestSyncScheduler",
- BackoffDelayProvider::FromDefaults(),
- context(), syncer_));
+ scheduler_ = base::MakeUnique<SyncSchedulerImpl>(
+ "TestSyncScheduler", BackoffDelayProvider::FromDefaults(), context(),
+ syncer_);
scheduler_->SetDefaultNudgeDelay(default_delay());
}
« no previous file with comments | « components/sync/engine_impl/sync_scheduler_impl.cc ('k') | components/sync/engine_impl/syncer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698