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

Unified Diff: runtime/vm/object.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/vm/json_stream.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 164ef23f464776873048bb48030bbf109324efda..ade7b9e321b688a636170c5e3820424e0501b663 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -5586,8 +5586,15 @@ class String : public Instance {
void ToUTF8(uint8_t* utf8_array, intptr_t array_len) const;
- // Produces a quoted, escaped, (possibly) truncated string.
- const char* ToUserCString(intptr_t max_len) const;
+ // Creates a UTF-8, NUL-terminated string in the current zone. The size of the
+ // created string in UTF-8 code units (bytes) is answered in 'length'; this
+ // can be longer than strlen of the result when the string has internal NULs.
+ // For the truncating version, 'max_length' is in UTF-16 code units, and will
+ // be rounded down if necessary to prevent splitting a surrogate pair.
+ const char* ToCString(intptr_t *length) const;
+ const char* ToCStringTruncated(intptr_t max_len,
+ bool* did_truncate,
+ intptr_t *length) const;
// Copies the string characters into the provided external array
// and morphs the string object into an external string object.
@@ -5733,9 +5740,6 @@ class String : public Instance {
CallbackType new_symbol,
Snapshot::Kind kind);
- intptr_t EscapedString(char* buffer, int max_len) const;
- intptr_t EscapedStringLen(intptr_t tooLong) const;
-
FINAL_HEAP_OBJECT_IMPLEMENTATION(String, Instance);
friend class Class;
« no previous file with comments | « runtime/vm/json_stream.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698