| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/assert.h" | 5 #include "platform/assert.h" |
| 6 | 6 |
| 7 #include "vm/dart_entry.h" | 7 #include "vm/dart_entry.h" |
| 8 #include "vm/debugger.h" | 8 #include "vm/debugger.h" |
| 9 #include "vm/json_stream.h" | 9 #include "vm/json_stream.h" |
| 10 #include "vm/message.h" | 10 #include "vm/message.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 void JSONStream::SetupNew(Zone* zone, | 87 void JSONStream::SetupNew(Zone* zone, |
| 88 Dart_Port reply_port, | 88 Dart_Port reply_port, |
| 89 const String& method, | 89 const String& method, |
| 90 const Array& option_keys, | 90 const Array& option_keys, |
| 91 const Array& option_values) { | 91 const Array& option_values) { |
| 92 set_reply_port(reply_port); | 92 set_reply_port(reply_port); |
| 93 command_ = method.ToCString(); | 93 command_ = method.ToCString(); |
| 94 | 94 |
| 95 String& string_iterator = String::Handle(); | 95 String& string_iterator = String::Handle(); |
| 96 if (option_keys.Length() > 0) { | 96 if (option_keys.Length() > 0) { |
| 97 ASSERT(option_keys.Length() == option_values.Length()); |
| 97 const char** option_keys_native = | 98 const char** option_keys_native = |
| 98 zone->Alloc<const char*>(option_keys.Length()); | 99 zone->Alloc<const char*>(option_keys.Length()); |
| 99 const char** option_values_native = | 100 const char** option_values_native = |
| 100 zone->Alloc<const char*>(option_keys.Length()); | 101 zone->Alloc<const char*>(option_keys.Length()); |
| 101 for (intptr_t i = 0; i < option_keys.Length(); i++) { | 102 for (intptr_t i = 0; i < option_keys.Length(); i++) { |
| 102 string_iterator ^= option_keys.At(i); | 103 string_iterator ^= option_keys.At(i); |
| 103 option_keys_native[i] = | 104 option_keys_native[i] = |
| 104 zone->MakeCopyOfString(string_iterator.ToCString()); | 105 zone->MakeCopyOfString(string_iterator.ToCString()); |
| 105 string_iterator ^= option_values.At(i); | 106 string_iterator ^= option_values.At(i); |
| 106 option_values_native[i] = | 107 option_values_native[i] = |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 intptr_t len2 = OS::VSNPrint(p, len+1, format, args); | 547 intptr_t len2 = OS::VSNPrint(p, len+1, format, args); |
| 547 va_end(args); | 548 va_end(args); |
| 548 ASSERT(len == len2); | 549 ASSERT(len == len2); |
| 549 stream_->buffer_.AddChar('"'); | 550 stream_->buffer_.AddChar('"'); |
| 550 stream_->AddEscapedUTF8String(p); | 551 stream_->AddEscapedUTF8String(p); |
| 551 stream_->buffer_.AddChar('"'); | 552 stream_->buffer_.AddChar('"'); |
| 552 free(p); | 553 free(p); |
| 553 } | 554 } |
| 554 | 555 |
| 555 } // namespace dart | 556 } // namespace dart |
| OLD | NEW |