Index: base/json/json_reader.cc |
diff --git a/base/json/json_reader.cc b/base/json/json_reader.cc |
index bbaf5fb349bcf396d9fa26f6ba0269faac0d9315..c7f62bb6bf5752b3b423baa333386ecbe9f73f3a 100644 |
--- a/base/json/json_reader.cc |
+++ b/base/json/json_reader.cc |
@@ -4,6 +4,7 @@ |
#include "base/json/json_reader.h" |
+#include "base/basictypes.h" |
#include "base/float_util.h" |
#include "base/logging.h" |
#include "base/memory/scoped_ptr.h" |
@@ -390,14 +391,19 @@ JSONReader::Token JSONReader::ParseNumberToken() { |
} |
Value* JSONReader::DecodeNumber(const Token& token) { |
- const std::wstring num_string(token.begin, token.length); |
+ const std::wstring num_wstring(token.begin, token.length); |
+ const std::string& num_string(WideToUTF8(num_wstring)); |
int num_int; |
- if (StringToInt(WideToUTF8(num_string), &num_int)) |
+ if (StringToInt(num_string, &num_int)) |
return Value::CreateIntegerValue(num_int); |
+ int64 num_int64; |
+ if (StringToInt64(num_string, &num_int64)) |
+ return Value::CreateInteger64Value(num_int64); |
+ |
double num_double; |
- if (StringToDouble(WideToUTF8(num_string), &num_double) && |
+ if (StringToDouble(num_string, &num_double) && |
base::IsFinite(num_double)) |
return Value::CreateDoubleValue(num_double); |