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

Unified Diff: base/values.cc

Issue 2664753002: Remove base::StringValue (Closed)
Patch Set: Rebase Created 3 years, 9 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 | « base/values.h ('k') | base/values_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/values.cc
diff --git a/base/values.cc b/base/values.cc
index 9aa04f33c64b1cc1eee031f1e89b03ed7b5bb358..18be7c79ef00072002a76cb50c6e9e20b9de3f48 100644
--- a/base/values.cc
+++ b/base/values.cc
@@ -290,9 +290,9 @@ bool Value::GetAsString(string16* out_value) const {
return is_string();
}
-bool Value::GetAsString(const StringValue** out_value) const {
+bool Value::GetAsString(const Value** out_value) const {
if (out_value && is_string()) {
- *out_value = static_cast<const StringValue*>(this);
+ *out_value = static_cast<const Value*>(this);
return true;
}
return is_string();
@@ -359,14 +359,12 @@ Value* Value::DeepCopy() const {
return new Value(int_value_);
case Type::DOUBLE:
return new Value(double_value_);
- // For now, make StringValues for backward-compatibility. Convert to
- // Value when that code is deleted.
case Type::STRING:
- return new StringValue(*string_value_);
+ return new Value(*string_value_);
// For now, make BinaryValues for backward-compatibility. Convert to
// Value when that code is deleted.
case Type::BINARY:
- return new BinaryValue(*binary_value_);
+ return new Value(*binary_value_);
// TODO(crbug.com/646113): Clean this up when DictionaryValue and ListValue
// are completely inlined.
@@ -683,11 +681,11 @@ void DictionaryValue::SetDouble(StringPiece path, double in_value) {
}
void DictionaryValue::SetString(StringPiece path, StringPiece in_value) {
- Set(path, new StringValue(in_value));
+ Set(path, new Value(in_value));
}
void DictionaryValue::SetString(StringPiece path, const string16& in_value) {
- Set(path, new StringValue(in_value));
+ Set(path, new Value(in_value));
}
void DictionaryValue::SetWithoutPathExpansion(StringPiece key,
@@ -717,12 +715,12 @@ void DictionaryValue::SetDoubleWithoutPathExpansion(StringPiece path,
void DictionaryValue::SetStringWithoutPathExpansion(StringPiece path,
StringPiece in_value) {
- SetWithoutPathExpansion(path, base::MakeUnique<base::StringValue>(in_value));
+ SetWithoutPathExpansion(path, base::MakeUnique<base::Value>(in_value));
}
void DictionaryValue::SetStringWithoutPathExpansion(StringPiece path,
const string16& in_value) {
- SetWithoutPathExpansion(path, base::MakeUnique<base::StringValue>(in_value));
+ SetWithoutPathExpansion(path, base::MakeUnique<base::Value>(in_value));
}
bool DictionaryValue::Get(StringPiece path,
@@ -1281,11 +1279,11 @@ void ListValue::AppendDouble(double in_value) {
}
void ListValue::AppendString(StringPiece in_value) {
- Append(MakeUnique<StringValue>(in_value));
+ Append(MakeUnique<Value>(in_value));
}
void ListValue::AppendString(const string16& in_value) {
- Append(MakeUnique<StringValue>(in_value));
+ Append(MakeUnique<Value>(in_value));
}
void ListValue::AppendStrings(const std::vector<std::string>& in_values) {
« no previous file with comments | « base/values.h ('k') | base/values_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698