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 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 stream_id_cobj.value.as_string = const_cast<char*>(stream_id); | 730 stream_id_cobj.value.as_string = const_cast<char*>(stream_id); |
731 list_values[0] = &stream_id_cobj; | 731 list_values[0] = &stream_id_cobj; |
732 | 732 |
733 Dart_CObject json_cobj; | 733 Dart_CObject json_cobj; |
734 json_cobj.type = Dart_CObject_kString; | 734 json_cobj.type = Dart_CObject_kString; |
735 json_cobj.value.as_string = const_cast<char*>(event->ToCString()); | 735 json_cobj.value.as_string = const_cast<char*>(event->ToCString()); |
736 list_values[1] = &json_cobj; | 736 list_values[1] = &json_cobj; |
737 | 737 |
738 if (FLAG_trace_service) { | 738 if (FLAG_trace_service) { |
739 Isolate* isolate = Isolate::Current(); | 739 Isolate* isolate = Isolate::Current(); |
740 ASSERT(isolate != NULL); | 740 const char* isolate_name = "<no current isolate>"; |
| 741 if (isolate != NULL) { |
| 742 isolate_name = isolate->name(); |
| 743 } |
741 OS::Print( | 744 OS::Print( |
742 "vm-service: Pushing event of type %s to stream %s (%s)\n", | 745 "vm-service: Pushing event of type %s to stream %s (%s)\n", |
743 kind, stream_id, isolate->name()); | 746 kind, stream_id, isolate_name); |
744 } | 747 } |
745 | 748 |
746 Dart_PostCObject(ServiceIsolate::Port(), &list_cobj); | 749 Dart_PostCObject(ServiceIsolate::Port(), &list_cobj); |
747 } | 750 } |
748 | 751 |
749 | 752 |
750 class EmbedderServiceHandler { | 753 class EmbedderServiceHandler { |
751 public: | 754 public: |
752 explicit EmbedderServiceHandler(const char* name) : name_(NULL), | 755 explicit EmbedderServiceHandler(const char* name) : name_(NULL), |
753 callback_(NULL), | 756 callback_(NULL), |
(...skipping 2385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3139 ServiceMethodDescriptor& method = service_methods_[i]; | 3142 ServiceMethodDescriptor& method = service_methods_[i]; |
3140 if (strcmp(method_name, method.name) == 0) { | 3143 if (strcmp(method_name, method.name) == 0) { |
3141 return &method; | 3144 return &method; |
3142 } | 3145 } |
3143 } | 3146 } |
3144 return NULL; | 3147 return NULL; |
3145 } | 3148 } |
3146 | 3149 |
3147 | 3150 |
3148 } // namespace dart | 3151 } // namespace dart |
OLD | NEW |