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 "vm/service.h" | 5 #include "vm/service.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
9 #include "platform/globals.h" | 9 #include "platform/globals.h" |
10 | 10 |
(...skipping 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1438 if (!GetUnsignedIntegerId(parts[1], &message_id, 16)) { | 1438 if (!GetUnsignedIntegerId(parts[1], &message_id, 16)) { |
1439 return Object::sentinel().raw(); | 1439 return Object::sentinel().raw(); |
1440 } | 1440 } |
1441 MessageHandler::AcquiredQueues aq; | 1441 MessageHandler::AcquiredQueues aq; |
1442 thread->isolate()->message_handler()->AcquireQueues(&aq); | 1442 thread->isolate()->message_handler()->AcquireQueues(&aq); |
1443 Message* message = aq.queue()->FindMessageById(message_id); | 1443 Message* message = aq.queue()->FindMessageById(message_id); |
1444 if (message == NULL) { | 1444 if (message == NULL) { |
1445 // The user may try to load an expired message. | 1445 // The user may try to load an expired message. |
1446 return Object::sentinel().raw(); | 1446 return Object::sentinel().raw(); |
1447 } | 1447 } |
1448 MessageSnapshotReader reader(message->data(), | 1448 if (message->len() > 0) { |
1449 message->len(), | 1449 MessageSnapshotReader reader(message->data(), |
1450 thread); | 1450 message->len(), |
1451 return reader.ReadObject(); | 1451 thread); |
| 1452 return reader.ReadObject(); |
| 1453 } else { |
| 1454 return message->raw_obj(); |
| 1455 } |
1452 } | 1456 } |
1453 | 1457 |
1454 | 1458 |
1455 static RawObject* LookupHeapObject(Thread* thread, | 1459 static RawObject* LookupHeapObject(Thread* thread, |
1456 const char* id_original, | 1460 const char* id_original, |
1457 ObjectIdRing::LookupResult* result) { | 1461 ObjectIdRing::LookupResult* result) { |
1458 char* id = thread->zone()->MakeCopyOfString(id_original); | 1462 char* id = thread->zone()->MakeCopyOfString(id_original); |
1459 | 1463 |
1460 // Parse the id by splitting at each '/'. | 1464 // Parse the id by splitting at each '/'. |
1461 const int MAX_PARTS = 8; | 1465 const int MAX_PARTS = 8; |
(...skipping 2093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3555 const ServiceMethodDescriptor& method = service_methods_[i]; | 3559 const ServiceMethodDescriptor& method = service_methods_[i]; |
3556 if (strcmp(method_name, method.name) == 0) { | 3560 if (strcmp(method_name, method.name) == 0) { |
3557 return &method; | 3561 return &method; |
3558 } | 3562 } |
3559 } | 3563 } |
3560 return NULL; | 3564 return NULL; |
3561 } | 3565 } |
3562 | 3566 |
3563 | 3567 |
3564 } // namespace dart | 3568 } // namespace dart |
OLD | NEW |