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

Unified Diff: components/sync/base/proto_value_ptr_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/base/proto_value_ptr_unittest.cc
diff --git a/components/sync/base/proto_value_ptr_unittest.cc b/components/sync/base/proto_value_ptr_unittest.cc
index 7531ce152e79f3a6396b6c184b9b3eb6b5d5e564..57755912af0f979dd9d986e9139e3a5263d66dc5 100644
--- a/components/sync/base/proto_value_ptr_unittest.cc
+++ b/components/sync/base/proto_value_ptr_unittest.cc
@@ -8,6 +8,7 @@
#include <utility>
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace syncer {
@@ -59,7 +60,7 @@ class TestValue {
ASSERT_FALSE(is_default());
ASSERT_TRUE(from.is_initialized());
ASSERT_FALSE(from.is_default());
- value_.reset(new IntValue(from.value()));
+ value_ = base::MakeUnique<IntValue>(from.value());
g_copy_count++;
}
@@ -82,7 +83,7 @@ class TestValue {
ASSERT_FALSE(is_default());
// The blob is an address of an integer
ASSERT_EQ(static_cast<int>(sizeof(int)), length);
- value_.reset(new IntValue(*static_cast<const int*>(blob)));
+ value_ = base::MakeUnique<IntValue>(*static_cast<const int*>(blob));
g_parse_count++;
}
« no previous file with comments | « components/sync/base/cryptographer.cc ('k') | components/sync/device_info/device_info_data_type_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698