| 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/globals.h" | 5 #include "platform/globals.h" |
| 6 | 6 |
| 7 #include "include/dart_debugger_api.h" | 7 #include "include/dart_debugger_api.h" |
| 8 #include "vm/dart_api_impl.h" | 8 #include "vm/dart_api_impl.h" |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/debugger.h" | 10 #include "vm/debugger.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 ~ServiceTestMessageHandler() { | 28 ~ServiceTestMessageHandler() { |
| 29 free(_msg); | 29 free(_msg); |
| 30 } | 30 } |
| 31 | 31 |
| 32 bool HandleMessage(Message* message) { | 32 bool HandleMessage(Message* message) { |
| 33 if (_msg != NULL) { | 33 if (_msg != NULL) { |
| 34 free(_msg); | 34 free(_msg); |
| 35 } | 35 } |
| 36 | 36 |
| 37 // Parse the message. | 37 // Parse the message. |
| 38 SnapshotReader reader(message->data(), message->len(), Snapshot::kMessage, | 38 MessageSnapshotReader reader(message->data(), |
| 39 Isolate::Current(), Thread::Current()->zone()); | 39 message->len(), |
| 40 Isolate::Current(), |
| 41 Thread::Current()->zone()); |
| 40 const Object& response_obj = Object::Handle(reader.ReadObject()); | 42 const Object& response_obj = Object::Handle(reader.ReadObject()); |
| 41 String& response = String::Handle(); | 43 String& response = String::Handle(); |
| 42 response ^= response_obj.raw(); | 44 response ^= response_obj.raw(); |
| 43 _msg = strdup(response.ToCString()); | 45 _msg = strdup(response.ToCString()); |
| 44 return true; | 46 return true; |
| 45 } | 47 } |
| 46 | 48 |
| 47 const char* msg() const { return _msg; } | 49 const char* msg() const { return _msg; } |
| 48 | 50 |
| 49 private: | 51 private: |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 Eval(lib, "[0, port, '0', 'getCpuProfile', ['tags'], ['Bogus']]"); | 622 Eval(lib, "[0, port, '0', 'getCpuProfile', ['tags'], ['Bogus']]"); |
| 621 Service::HandleIsolateMessage(isolate, service_msg); | 623 Service::HandleIsolateMessage(isolate, service_msg); |
| 622 handler.HandleNextMessage(); | 624 handler.HandleNextMessage(); |
| 623 // Expect error. | 625 // Expect error. |
| 624 EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg()); | 626 EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg()); |
| 625 } | 627 } |
| 626 | 628 |
| 627 #endif // !defined(TARGET_ARCH_ARM64) | 629 #endif // !defined(TARGET_ARCH_ARM64) |
| 628 | 630 |
| 629 } // namespace dart | 631 } // namespace dart |
| OLD | NEW |