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

Unified Diff: components/prefs/pref_value_map.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/pref_value_map.cc
diff --git a/components/prefs/pref_value_map.cc b/components/prefs/pref_value_map.cc
index 7b267cc7d16625eed85c26e21d464c25c958ec94..aba82e08adca3f47c57187c75280e2fee3607056 100644
--- a/components/prefs/pref_value_map.cc
+++ b/components/prefs/pref_value_map.cc
@@ -5,10 +5,11 @@
#include "components/prefs/pref_value_map.h"
#include <map>
+#include <memory>
#include <utility>
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
+#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
#include "base/values.h"
@@ -34,7 +35,7 @@ bool PrefValueMap::GetValue(const std::string& key, base::Value** value) {
}
bool PrefValueMap::SetValue(const std::string& key,
- scoped_ptr<base::Value> value) {
+ std::unique_ptr<base::Value> value) {
DCHECK(value);
base::Value* old_value = prefs_.get(key);
@@ -80,7 +81,7 @@ bool PrefValueMap::GetBoolean(const std::string& key,
}
void PrefValueMap::SetBoolean(const std::string& key, bool value) {
- SetValue(key, make_scoped_ptr(new base::FundamentalValue(value)));
+ SetValue(key, base::WrapUnique(new base::FundamentalValue(value)));
}
bool PrefValueMap::GetString(const std::string& key,
@@ -91,7 +92,7 @@ bool PrefValueMap::GetString(const std::string& key,
void PrefValueMap::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)));
}
bool PrefValueMap::GetInteger(const std::string& key, int* value) const {
@@ -100,11 +101,11 @@ bool PrefValueMap::GetInteger(const std::string& key, int* value) const {
}
void PrefValueMap::SetInteger(const std::string& key, const int value) {
- SetValue(key, make_scoped_ptr(new base::FundamentalValue(value)));
+ SetValue(key, base::WrapUnique(new base::FundamentalValue(value)));
}
void PrefValueMap::SetDouble(const std::string& key, const double value) {
- SetValue(key, make_scoped_ptr(new base::FundamentalValue(value)));
+ SetValue(key, base::WrapUnique(new base::FundamentalValue(value)));
}
void PrefValueMap::GetDifferingKeys(

Powered by Google App Engine
This is Rietveld 408576698