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

Unified Diff: base/values.cc

Issue 2476493003: Remove FundamentalValue
Patch Set: Fix Created 4 years, 1 month 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 3d2bb6c6e6a2b2ca3d7b7b3fd743ab1de521a10d..678b43179bda92c15f25eeac81d713e6bc3834b4 100644
--- a/base/values.cc
+++ b/base/values.cc
@@ -188,15 +188,12 @@ Value* Value::DeepCopy() const {
switch (type()) {
case TYPE_NULL:
return CreateNullValue().release();
-
- // For now, make FundamentalValues for backward-compatibility. Convert to
- // Value when that code is deleted.
case TYPE_BOOLEAN:
- return new FundamentalValue(bool_value_);
+ return new Value(bool_value_);
case TYPE_INTEGER:
- return new FundamentalValue(int_value_);
+ return new Value(int_value_);
case TYPE_DOUBLE:
- return new FundamentalValue(double_value_);
+ return new Value(double_value_);
default:
// All other types should be handled by subclasses.
@@ -246,23 +243,6 @@ Value& Value::operator=(const Value& that) {
return *this;
}
-///////////////////// FundamentalValue ////////////////////
-
-FundamentalValue::FundamentalValue(bool in_value)
- : Value(in_value) {
-}
-
-FundamentalValue::FundamentalValue(int in_value)
- : Value(in_value) {
-}
-
-FundamentalValue::FundamentalValue(double in_value)
- : Value(in_value) {
-}
-
-FundamentalValue::~FundamentalValue() {
-}
-
///////////////////// StringValue ////////////////////
StringValue::StringValue(StringPiece in_value)
@@ -431,15 +411,15 @@ void DictionaryValue::Set(StringPiece path, Value* in_value) {
}
void DictionaryValue::SetBoolean(StringPiece path, bool in_value) {
- Set(path, new FundamentalValue(in_value));
+ Set(path, new Value(in_value));
}
void DictionaryValue::SetInteger(StringPiece path, int in_value) {
- Set(path, new FundamentalValue(in_value));
+ Set(path, new Value(in_value));
}
void DictionaryValue::SetDouble(StringPiece path, double in_value) {
- Set(path, new FundamentalValue(in_value));
+ Set(path, new Value(in_value));
}
void DictionaryValue::SetString(StringPiece path, StringPiece in_value) {
@@ -462,20 +442,17 @@ void DictionaryValue::SetWithoutPathExpansion(StringPiece key,
void DictionaryValue::SetBooleanWithoutPathExpansion(StringPiece path,
bool in_value) {
- SetWithoutPathExpansion(path,
- base::MakeUnique<base::FundamentalValue>(in_value));
+ SetWithoutPathExpansion(path, new Value(in_value));
}
void DictionaryValue::SetIntegerWithoutPathExpansion(StringPiece path,
int in_value) {
- SetWithoutPathExpansion(path,
- base::MakeUnique<base::FundamentalValue>(in_value));
+ SetWithoutPathExpansion(path, new Value(in_value));
}
void DictionaryValue::SetDoubleWithoutPathExpansion(StringPiece path,
double in_value) {
- SetWithoutPathExpansion(path,
- base::MakeUnique<base::FundamentalValue>(in_value));
+ SetWithoutPathExpansion(path, new Value(in_value));
}
void DictionaryValue::SetStringWithoutPathExpansion(StringPiece path,
@@ -1067,15 +1044,15 @@ void ListValue::Append(Value* in_value) {
#endif
void ListValue::AppendBoolean(bool in_value) {
- Append(MakeUnique<FundamentalValue>(in_value));
+ Append(MakeUnique<Value>(in_value));
}
void ListValue::AppendInteger(int in_value) {
- Append(MakeUnique<FundamentalValue>(in_value));
+ Append(MakeUnique<Value>(in_value));
}
void ListValue::AppendDouble(double in_value) {
- Append(MakeUnique<FundamentalValue>(in_value));
+ Append(MakeUnique<Value>(in_value));
}
void ListValue::AppendString(StringPiece in_value) {
« 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