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

Unified Diff: runtime/vm/json_stream.h

Issue 542363003: Don't double-escape in strings in the VM Service, and don't use \u0000 to determine the string lengt (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: build Created 6 years, 3 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 | « runtime/bin/vmservice/observatory/tests/ui/inspector.dart ('k') | runtime/vm/json_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/json_stream.h
diff --git a/runtime/vm/json_stream.h b/runtime/vm/json_stream.h
index 057fbf973fa5d917e3fc2b5c42c8ea01c7828dc1..1e843680a8e79610fcb3b556e76691058911a1e7 100644
--- a/runtime/vm/json_stream.h
+++ b/runtime/vm/json_stream.h
@@ -20,6 +20,7 @@ class JSONArray;
class JSONObject;
class Object;
class SourceBreakpoint;
+class String;
class Metric;
class Zone;
@@ -84,6 +85,7 @@ class JSONStream : ValueObject {
void PrintValue64(int64_t i);
void PrintValue(double d);
void PrintValue(const char* s);
+ void PrintValue(const char* s, intptr_t len);
void PrintValueNoEscape(const char* s);
void PrintfValue(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
void PrintValue(const Object& o, bool ref = true);
@@ -97,6 +99,7 @@ class JSONStream : ValueObject {
void PrintProperty64(const char* name, int64_t i);
void PrintProperty(const char* name, double d);
void PrintProperty(const char* name, const char* s);
+ void PrintProperty(const char* name, const char* s, intptr_t len);
void PrintPropertyNoEscape(const char* name, const char* s);
void PrintfProperty(const char* name, const char* format, ...)
PRINTF_ATTRIBUTE(3, 4);
@@ -111,6 +114,7 @@ class JSONStream : ValueObject {
bool NeedComma();
void AddEscapedUTF8String(const char* s);
+ void AddEscapedUTF8String(const char* s, intptr_t len);
intptr_t nesting_level() const { return open_objects_; }
@@ -159,6 +163,9 @@ class JSONObject : public ValueObject {
void AddProperty(const char* name, const char* s) const {
stream_->PrintProperty(name, s);
}
+ void AddProperty(const char* name, const char* s, intptr_t len) const {
+ stream_->PrintProperty(name, s, len);
+ }
void AddPropertyNoEscape(const char* name, const char* s) const {
stream_->PrintPropertyNoEscape(name, s);
}
« no previous file with comments | « runtime/bin/vmservice/observatory/tests/ui/inspector.dart ('k') | runtime/vm/json_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698