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

Unified Diff: base/json_writer.h

Issue 115397: DevTools: Introduce lightweight version of JSON serialization. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 | « no previous file | base/json_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json_writer.h
===================================================================
--- base/json_writer.h (revision 16147)
+++ base/json_writer.h (working copy)
@@ -23,12 +23,20 @@
static void Write(const Value* const node, bool pretty_print,
std::string* json);
+ // Same as above, but has an option to not escape the string, preserving its
+ // UTF8 characters. It is useful if you can pass resulting string to the
+ // JSON parser in binary form (as UTF8).
+ static void WriteWithOptionalEscape(const Value* const node,
+ bool pretty_print,
+ bool escape,
+ std::string* json);
+
private:
JSONWriter(bool pretty_print, std::string* json);
// Called recursively to build the JSON string. Whe completed, value is
// json_string_ will contain the JSON.
- void BuildJSONString(const Value* const node, int depth);
+ void BuildJSONString(const Value* const node, int depth, bool escape);
// Appends a quoted, escaped, version of str to json_string_.
void AppendQuotedString(const std::wstring& str);
« no previous file with comments | « no previous file | base/json_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698