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

Unified Diff: components/sync/test/engine/test_directory_setter_upper.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/syncable/test_user_share.cc ('k') | components/sync/tools/sync_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/test/engine/test_directory_setter_upper.cc
diff --git a/components/sync/test/engine/test_directory_setter_upper.cc b/components/sync/test/engine/test_directory_setter_upper.cc
index 29ff0b733ade79f3c22b04d820b72c9ae73af14f..baae9782bd4ce6ad1fb123bf3ced82a526a31dc0 100644
--- a/components/sync/test/engine/test_directory_setter_upper.cc
+++ b/components/sync/test/engine/test_directory_setter_upper.cc
@@ -6,6 +6,7 @@
#include "base/files/file_util.h"
#include "base/location.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_util.h"
#include "components/sync/syncable/directory.h"
#include "components/sync/syncable/in_memory_directory_backing_store.h"
@@ -22,14 +23,15 @@ TestDirectorySetterUpper::TestDirectorySetterUpper() : name_("Test") {}
TestDirectorySetterUpper::~TestDirectorySetterUpper() {}
void TestDirectorySetterUpper::SetUp() {
- test_transaction_observer_.reset(new syncable::TestTransactionObserver());
+ test_transaction_observer_ =
+ base::MakeUnique<syncable::TestTransactionObserver>();
WeakHandle<syncable::TransactionObserver> transaction_observer =
MakeWeakHandle(test_transaction_observer_->AsWeakPtr());
- directory_.reset(new syncable::Directory(
+ directory_ = base::MakeUnique<syncable::Directory>(
new syncable::InMemoryDirectoryBackingStore(name_),
MakeWeakHandle(handler_.GetWeakPtr()), base::Closure(),
- &encryption_handler_, encryption_handler_.cryptographer()));
+ &encryption_handler_, encryption_handler_.cryptographer());
ASSERT_EQ(syncable::OPENED,
directory_->Open(name_, &delegate_, transaction_observer));
}
@@ -37,13 +39,14 @@ void TestDirectorySetterUpper::SetUp() {
void TestDirectorySetterUpper::SetUpWith(
syncable::DirectoryBackingStore* directory_store) {
CHECK(directory_store);
- test_transaction_observer_.reset(new syncable::TestTransactionObserver());
+ test_transaction_observer_ =
+ base::MakeUnique<syncable::TestTransactionObserver>();
WeakHandle<syncable::TransactionObserver> transaction_observer =
MakeWeakHandle(test_transaction_observer_->AsWeakPtr());
- directory_.reset(new syncable::Directory(
+ directory_ = base::MakeUnique<syncable::Directory>(
directory_store, MakeWeakHandle(handler_.GetWeakPtr()), base::Closure(),
- &encryption_handler_, encryption_handler_.cryptographer()));
+ &encryption_handler_, encryption_handler_.cryptographer());
ASSERT_EQ(syncable::OPENED,
directory_->Open(name_, &delegate_, transaction_observer));
}
« no previous file with comments | « components/sync/syncable/test_user_share.cc ('k') | components/sync/tools/sync_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698