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

Unified Diff: runtime/bin/dbg_message.cc

Issue 11318018: - Represent strings internally in UTF-16 format, this makes it (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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
Index: runtime/bin/dbg_message.cc
===================================================================
--- runtime/bin/dbg_message.cc (revision 14314)
+++ runtime/bin/dbg_message.cc (working copy)
@@ -109,11 +109,11 @@
intptr_t str_len = 0;
Dart_Handle res = Dart_StringLength(str, &str_len);
ASSERT_NOT_ERROR(res);
- uint32_t* codepoints =
- reinterpret_cast<uint32_t*>(malloc(str_len * sizeof(uint32_t)));
+ uint16_t* codepoints =
+ reinterpret_cast<uint16_t*>(malloc(str_len * sizeof(uint16_t)));
ASSERT(codepoints != NULL);
intptr_t actual_len = str_len;
- res = Dart_StringGet32(str, codepoints, &actual_len);
+ res = Dart_StringToUTF16(str, codepoints, &actual_len);
ASSERT_NOT_ERROR(res);
ASSERT(str_len == actual_len);
buf->AddChar('\"');
@@ -692,7 +692,7 @@
intptr_t lib_id = msg_parser.GetIntParam("libraryId");
char* url_chars = msg_parser.GetStringParam("url");
ASSERT(url_chars != NULL);
- Dart_Handle url = Dart_NewString(url_chars);
+ Dart_Handle url = DartUtils::NewString(url_chars);
ASSERT_NOT_ERROR(url);
free(url_chars);
url_chars = NULL;
@@ -732,7 +732,7 @@
int msg_id = msg_parser.MessageId();
char* url_chars = msg_parser.GetStringParam("url");
ASSERT(url_chars != NULL);
- Dart_Handle url = Dart_NewString(url_chars);
+ Dart_Handle url = DartUtils::NewString(url_chars);
ASSERT_NOT_ERROR(url);
free(url_chars);
url_chars = NULL;
« no previous file with comments | « runtime/bin/dartutils.cc ('k') | runtime/bin/directory.cc » ('j') | runtime/vm/dart_api_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698