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

Unified Diff: components/prefs/testing_pref_store.cc

Issue 1907043002: Convert //components/prefs from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IWYU fixes Created 4 years, 8 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/prefs/testing_pref_store.cc
diff --git a/components/prefs/testing_pref_store.cc b/components/prefs/testing_pref_store.cc
index 3a8be42c9d83be0fc44fad6e26fd3efcdef001c7..426bd643f36c01e7ed362d5c92db2f8912b8aaf3 100644
--- a/components/prefs/testing_pref_store.cc
+++ b/components/prefs/testing_pref_store.cc
@@ -4,9 +4,10 @@
#include "components/prefs/testing_pref_store.h"
+#include <memory>
#include <utility>
-#include "base/memory/scoped_ptr.h"
+#include "base/memory/ptr_util.h"
#include "base/values.h"
TestingPrefStore::TestingPrefStore()
@@ -45,7 +46,7 @@ bool TestingPrefStore::IsInitializationComplete() const {
}
void TestingPrefStore::SetValue(const std::string& key,
- scoped_ptr<base::Value> value,
+ std::unique_ptr<base::Value> value,
uint32_t flags) {
if (prefs_.SetValue(key, std::move(value))) {
committed_ = false;
@@ -54,7 +55,7 @@ void TestingPrefStore::SetValue(const std::string& key,
}
void TestingPrefStore::SetValueSilently(const std::string& key,
- scoped_ptr<base::Value> value,
+ std::unique_ptr<base::Value> value,
uint32_t flags) {
if (prefs_.SetValue(key, std::move(value)))
committed_ = false;
@@ -117,17 +118,17 @@ void TestingPrefStore::ReportValueChanged(const std::string& key,
void TestingPrefStore::SetString(const std::string& key,
const std::string& value) {
- SetValue(key, make_scoped_ptr(new base::StringValue(value)),
+ SetValue(key, base::WrapUnique(new base::StringValue(value)),
DEFAULT_PREF_WRITE_FLAGS);
}
void TestingPrefStore::SetInteger(const std::string& key, int value) {
- SetValue(key, make_scoped_ptr(new base::FundamentalValue(value)),
+ SetValue(key, base::WrapUnique(new base::FundamentalValue(value)),
DEFAULT_PREF_WRITE_FLAGS);
}
void TestingPrefStore::SetBoolean(const std::string& key, bool value) {
- SetValue(key, make_scoped_ptr(new base::FundamentalValue(value)),
+ SetValue(key, base::WrapUnique(new base::FundamentalValue(value)),
DEFAULT_PREF_WRITE_FLAGS);
}

Powered by Google App Engine
This is Rietveld 408576698