summaryrefslogtreecommitdiffstats
path: root/base/json_writer.cc
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-26 21:17:24 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-26 21:17:24 +0000
commitb81637c3d9f2cf895b81d5b673b88668b6bc1322 (patch)
tree795f338852b7d40508e837ece010d64b4ad14d9f /base/json_writer.cc
parenteb0ef6ce145aab92fdf7f99f4ebe14ef7b03736c (diff)
downloadchromium_src-b81637c3d9f2cf895b81d5b673b88668b6bc1322.zip
chromium_src-b81637c3d9f2cf895b81d5b673b88668b6bc1322.tar.gz
chromium_src-b81637c3d9f2cf895b81d5b673b88668b6bc1322.tar.bz2
Use platform-appropriate newlines in JSON output.
BUG=15462 TEST=base_unittests, unit_tests, check newlines in bookmarks file Review URL: http://codereview.chromium.org/147220 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19418 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/json_writer.cc')
-rw-r--r--base/json_writer.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/base/json_writer.cc b/base/json_writer.cc
index a95798e..1a9f1b6 100644
--- a/base/json_writer.cc
+++ b/base/json_writer.cc
@@ -9,7 +9,11 @@
#include "base/values.h"
#include "base/string_escape.h"
-const char kPrettyPrintLineEnding[] = "\r\n";
+#if defined(OS_WIN)
+static const char kPrettyPrintLineEnding[] = "\r\n";
+#else
+static const char kPrettyPrintLineEnding[] = "\n";
+#endif
/* static */
void JSONWriter::Write(const Value* const node,