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

Unified Diff: components/prefs/pref_value_map.cc

Issue 2149253003: Switch various ValueTypeToString()s to base::Value::GetTypeName(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@value
Patch Set: rebase Created 4 years, 5 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/prefs/pref_value_map.h ('k') | tools/json_schema_compiler/test/error_generation_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/prefs/pref_value_map.cc
diff --git a/components/prefs/pref_value_map.cc b/components/prefs/pref_value_map.cc
index aba82e08adca3f47c57187c75280e2fee3607056..c146918e238eff6e027c7dc65cf201d45005ed92 100644
--- a/components/prefs/pref_value_map.cc
+++ b/components/prefs/pref_value_map.cc
@@ -74,6 +74,10 @@ PrefValueMap::const_iterator PrefValueMap::end() const {
return prefs_.end();
}
+bool PrefValueMap::empty() const {
+ return prefs_.empty();
+}
+
bool PrefValueMap::GetBoolean(const std::string& key,
bool* value) const {
const base::Value* stored_value = nullptr;
@@ -81,7 +85,7 @@ bool PrefValueMap::GetBoolean(const std::string& key,
}
void PrefValueMap::SetBoolean(const std::string& key, bool value) {
- SetValue(key, base::WrapUnique(new base::FundamentalValue(value)));
+ SetValue(key, base::MakeUnique<base::FundamentalValue>(value));
}
bool PrefValueMap::GetString(const std::string& key,
@@ -92,7 +96,7 @@ bool PrefValueMap::GetString(const std::string& key,
void PrefValueMap::SetString(const std::string& key,
const std::string& value) {
- SetValue(key, base::WrapUnique(new base::StringValue(value)));
+ SetValue(key, base::MakeUnique<base::StringValue>(value));
}
bool PrefValueMap::GetInteger(const std::string& key, int* value) const {
@@ -101,11 +105,11 @@ bool PrefValueMap::GetInteger(const std::string& key, int* value) const {
}
void PrefValueMap::SetInteger(const std::string& key, const int value) {
- SetValue(key, base::WrapUnique(new base::FundamentalValue(value)));
+ SetValue(key, base::MakeUnique<base::FundamentalValue>(value));
}
void PrefValueMap::SetDouble(const std::string& key, const double value) {
- SetValue(key, base::WrapUnique(new base::FundamentalValue(value)));
+ SetValue(key, base::MakeUnique<base::FundamentalValue>(value));
}
void PrefValueMap::GetDifferingKeys(
« no previous file with comments | « components/prefs/pref_value_map.h ('k') | tools/json_schema_compiler/test/error_generation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698