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

Unified Diff: base/json/json_parser.cc

Issue 11519026: base: Do not use Value::Create* functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: scoped_ptr Created 8 years 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 | « no previous file | base/json/json_writer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/json_parser.cc
diff --git a/base/json/json_parser.cc b/base/json/json_parser.cc
index 02295de53e40379e777c5d01dbbba06332f60fb8..4c03a985568e8e8310af834b4f8bf9757c496fba 100644
--- a/base/json/json_parser.cc
+++ b/base/json/json_parser.cc
@@ -148,7 +148,7 @@ class JSONStringValue : public base::Value {
return true;
}
virtual Value* DeepCopy() const OVERRIDE {
- return Value::CreateStringValue(string_piece_.as_string());
+ return new StringValue(string_piece_.as_string());
}
virtual bool Equals(const Value* other) const OVERRIDE {
std::string other_string;
@@ -865,12 +865,12 @@ Value* JSONParser::ConsumeNumber() {
int num_int;
if (StringToInt(num_string, &num_int))
- return Value::CreateIntegerValue(num_int);
+ return new FundamentalValue(num_int);
double num_double;
if (base::StringToDouble(num_string.as_string(), &num_double) &&
IsFinite(num_double)) {
- return Value::CreateDoubleValue(num_double);
+ return new FundamentalValue(num_double);
}
return NULL;
@@ -906,7 +906,7 @@ Value* JSONParser::ConsumeLiteral() {
return NULL;
}
NextNChars(kTrueLen - 1);
- return Value::CreateBooleanValue(true);
+ return new FundamentalValue(true);
}
case 'f': {
const char* kFalseLiteral = "false";
@@ -917,7 +917,7 @@ Value* JSONParser::ConsumeLiteral() {
return NULL;
}
NextNChars(kFalseLen - 1);
- return Value::CreateBooleanValue(false);
+ return new FundamentalValue(false);
}
case 'n': {
const char* kNullLiteral = "null";
« no previous file with comments | « no previous file | base/json/json_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698