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

Unified Diff: components/sync/syncable/test_user_share.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/syncable/test_user_share.cc
diff --git a/components/sync/syncable/test_user_share.cc b/components/sync/syncable/test_user_share.cc
index f50cfbf233e5156dee48e0a4a6f598fcd71d5b81..6dbdd470f6c74b218777ae7ca039dd4f1338513e 100644
--- a/components/sync/syncable/test_user_share.cc
+++ b/components/sync/syncable/test_user_share.cc
@@ -5,6 +5,7 @@
#include "components/sync/syncable/test_user_share.h"
#include "base/compiler_specific.h"
+#include "base/memory/ptr_util.h"
#include "components/sync/syncable/directory.h"
#include "components/sync/syncable/mutable_entry.h"
#include "components/sync/syncable/syncable_read_transaction.h"
@@ -24,7 +25,7 @@ TestUserShare::~TestUserShare() {
}
void TestUserShare::SetUp() {
- user_share_.reset(new UserShare());
+ user_share_ = base::MakeUnique<UserShare>();
dir_maker_->SetUp();
// The pointer is owned by dir_maker_, we should not be storing it in a
@@ -49,7 +50,7 @@ bool TestUserShare::Reload() {
// Ensure the unique_ptr doesn't delete the memory we don't own.
ignore_result(user_share_->directory.release());
- user_share_.reset(new UserShare());
+ user_share_ = base::MakeUnique<UserShare>();
dir_maker_->SetUpWith(saved_store);
user_share_->directory.reset(dir_maker_->directory());
return true;
« no previous file with comments | « components/sync/syncable/syncable_unittest.cc ('k') | components/sync/test/engine/test_directory_setter_upper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698