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

Unified Diff: base/json/json_writer.cc

Issue 8962042: Add TYPE_INTEGER64 type to base::Value. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | « base/json/json_reader_unittest.cc ('k') | 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_writer.cc
diff --git a/base/json/json_writer.cc b/base/json/json_writer.cc
index f457331165004ebcc91226d6fbf2e26965e402df..d93e22fdb0ba9b3e5b43c145de29ea11415f9e0b 100644
--- a/base/json/json_writer.cc
+++ b/base/json/json_writer.cc
@@ -4,6 +4,8 @@
#include "base/json/json_writer.h"
+#include "base/basictypes.h"
+#include "base/format_macros.h"
#include "base/json/string_escape.h"
#include "base/logging.h"
#include "base/stringprintf.h"
@@ -78,6 +80,15 @@ void JSONWriter::BuildJSONString(const Value* const node,
break;
}
+ case Value::TYPE_INTEGER64:
+ {
+ int64 value;
+ bool result = node->GetAsInteger64(&value);
+ DCHECK(result);
+ base::StringAppendF(json_string_, "%" PRId64, value);
+ break;
+ }
+
case Value::TYPE_DOUBLE:
{
double value;
« no previous file with comments | « base/json/json_reader_unittest.cc ('k') | base/json/json_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698