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

Unified Diff: base/values.cc

Issue 131503015: Get rid of some uses of base::Create*Value (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more Created 6 years, 11 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/prefs/pref_service_unittest.cc ('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 6068556bb3d1a4738b0048c118577a8670aef6be..fa256aade3d9cdc1b096d8ed571268d4c86ba2ef 100644
--- a/base/values.cc
+++ b/base/values.cc
@@ -225,13 +225,13 @@ bool FundamentalValue::GetAsDouble(double* out_value) const {
FundamentalValue* FundamentalValue::DeepCopy() const {
switch (GetType()) {
case TYPE_BOOLEAN:
- return CreateBooleanValue(boolean_value_);
+ return new FundamentalValue(boolean_value_);
case TYPE_INTEGER:
- return CreateIntegerValue(integer_value_);
+ return new FundamentalValue(integer_value_);
case TYPE_DOUBLE:
- return CreateDoubleValue(double_value_);
+ return new FundamentalValue(double_value_);
default:
NOTREACHED();
@@ -291,7 +291,7 @@ bool StringValue::GetAsString(string16* out_value) const {
}
StringValue* StringValue::DeepCopy() const {
- return CreateStringValue(value_);
+ return new StringValue(value_);
}
bool StringValue::Equals(const Value* other) const {
@@ -403,25 +403,25 @@ void DictionaryValue::Set(const std::string& path, Value* in_value) {
}
void DictionaryValue::SetBoolean(const std::string& path, bool in_value) {
- Set(path, CreateBooleanValue(in_value));
+ Set(path, new FundamentalValue(in_value));
}
void DictionaryValue::SetInteger(const std::string& path, int in_value) {
- Set(path, CreateIntegerValue(in_value));
+ Set(path, new FundamentalValue(in_value));
}
void DictionaryValue::SetDouble(const std::string& path, double in_value) {
- Set(path, CreateDoubleValue(in_value));
+ Set(path, new FundamentalValue(in_value));
}
void DictionaryValue::SetString(const std::string& path,
const std::string& in_value) {
- Set(path, CreateStringValue(in_value));
+ Set(path, new StringValue(in_value));
}
void DictionaryValue::SetString(const std::string& path,
const string16& in_value) {
- Set(path, CreateStringValue(in_value));
+ Set(path, new StringValue(in_value));
}
void DictionaryValue::SetWithoutPathExpansion(const std::string& key,
@@ -439,27 +439,27 @@ void DictionaryValue::SetWithoutPathExpansion(const std::string& key,
void DictionaryValue::SetBooleanWithoutPathExpansion(
const std::string& path, bool in_value) {
- SetWithoutPathExpansion(path, CreateBooleanValue(in_value));
+ SetWithoutPathExpansion(path, new FundamentalValue(in_value));
}
void DictionaryValue::SetIntegerWithoutPathExpansion(
const std::string& path, int in_value) {
- SetWithoutPathExpansion(path, CreateIntegerValue(in_value));
+ SetWithoutPathExpansion(path, new FundamentalValue(in_value));
}
void DictionaryValue::SetDoubleWithoutPathExpansion(
const std::string& path, double in_value) {
- SetWithoutPathExpansion(path, CreateDoubleValue(in_value));
+ SetWithoutPathExpansion(path, new FundamentalValue(in_value));
}
void DictionaryValue::SetStringWithoutPathExpansion(
const std::string& path, const std::string& in_value) {
- SetWithoutPathExpansion(path, CreateStringValue(in_value));
+ SetWithoutPathExpansion(path, new StringValue(in_value));
}
void DictionaryValue::SetStringWithoutPathExpansion(
const std::string& path, const string16& in_value) {
- SetWithoutPathExpansion(path, CreateStringValue(in_value));
+ SetWithoutPathExpansion(path, new StringValue(in_value));
}
bool DictionaryValue::Get(const std::string& path,
@@ -1025,23 +1025,23 @@ void ListValue::Append(Value* in_value) {
}
void ListValue::AppendBoolean(bool in_value) {
- Append(CreateBooleanValue(in_value));
+ Append(new FundamentalValue(in_value));
}
void ListValue::AppendInteger(int in_value) {
- Append(CreateIntegerValue(in_value));
+ Append(new FundamentalValue(in_value));
}
void ListValue::AppendDouble(double in_value) {
- Append(CreateDoubleValue(in_value));
+ Append(new FundamentalValue(in_value));
}
void ListValue::AppendString(const std::string& in_value) {
- Append(CreateStringValue(in_value));
+ Append(new StringValue(in_value));
}
void ListValue::AppendString(const string16& in_value) {
- Append(CreateStringValue(in_value));
+ Append(new StringValue(in_value));
}
void ListValue::AppendStrings(const std::vector<std::string>& in_values) {
« no previous file with comments | « base/prefs/pref_service_unittest.cc ('k') | base/values_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698