OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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/bootstrap_natives.h" | 5 #include "vm/bootstrap_natives.h" |
6 #include "vm/dart_api_impl.h" | 6 #include "vm/dart_api_impl.h" |
7 #include "vm/datastream.h" | 7 #include "vm/datastream.h" |
8 #include "vm/exceptions.h" | 8 #include "vm/exceptions.h" |
9 #include "vm/flags.h" | 9 #include "vm/flags.h" |
10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 // TODO(turnidge): Throw an exception when the return value is false? | 115 // TODO(turnidge): Throw an exception when the return value is false? |
116 bool result = PortMap::PostMessage( | 116 bool result = PortMap::PostMessage( |
117 new Message(sp.Id(), data, writer.BytesWritten(), Message::kOOBPriority)); | 117 new Message(sp.Id(), data, writer.BytesWritten(), Message::kOOBPriority)); |
118 return Bool::Get(result).raw(); | 118 return Bool::Get(result).raw(); |
119 } | 119 } |
120 | 120 |
121 | 121 |
122 DEFINE_NATIVE_ENTRY(VMService_SendRootServiceMessage, 1) { | 122 DEFINE_NATIVE_ENTRY(VMService_SendRootServiceMessage, 1) { |
123 GET_NON_NULL_NATIVE_ARGUMENT(Array, message, arguments->NativeArgAt(0)); | 123 GET_NON_NULL_NATIVE_ARGUMENT(Array, message, arguments->NativeArgAt(0)); |
124 if (FLAG_support_service) { | 124 if (FLAG_support_service) { |
125 Service::HandleRootMessage(message); | 125 return Service::HandleRootMessage(message); |
126 } | 126 } |
127 return Object::null(); | 127 return Object::null(); |
128 } | 128 } |
129 | 129 |
130 | 130 |
131 DEFINE_NATIVE_ENTRY(VMService_SendObjectRootServiceMessage, 1) { | 131 DEFINE_NATIVE_ENTRY(VMService_SendObjectRootServiceMessage, 1) { |
132 GET_NON_NULL_NATIVE_ARGUMENT(Array, message, arguments->NativeArgAt(0)); | 132 GET_NON_NULL_NATIVE_ARGUMENT(Array, message, arguments->NativeArgAt(0)); |
133 if (FLAG_support_service) { | 133 if (FLAG_support_service) { |
134 Service::HandleObjectRootMessage(message); | 134 return Service::HandleObjectRootMessage(message); |
135 } | 135 } |
136 return Object::null(); | 136 return Object::null(); |
137 } | 137 } |
138 | 138 |
139 | 139 |
140 DEFINE_NATIVE_ENTRY(VMService_OnStart, 0) { | 140 DEFINE_NATIVE_ENTRY(VMService_OnStart, 0) { |
141 if (FLAG_trace_service) { | 141 if (FLAG_trace_service) { |
142 OS::Print("vm-service: Booting dart:vmservice library.\n"); | 142 OS::Print("vm-service: Booting dart:vmservice library.\n"); |
143 } | 143 } |
144 // Boot the dart:vmservice library. | 144 // Boot the dart:vmservice library. |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 ServiceEvent spawn_event(NULL, ServiceEvent::kIsolateSpawn); | 479 ServiceEvent spawn_event(NULL, ServiceEvent::kIsolateSpawn); |
480 spawn_event.set_spawn_token(&token); | 480 spawn_event.set_spawn_token(&token); |
481 spawn_event.set_spawn_error(&String::Cast(result)); | 481 spawn_event.set_spawn_error(&String::Cast(result)); |
482 Service::HandleEvent(&spawn_event); | 482 Service::HandleEvent(&spawn_event); |
483 } | 483 } |
484 #endif // PRODUCT | 484 #endif // PRODUCT |
485 return Object::null(); | 485 return Object::null(); |
486 } | 486 } |
487 | 487 |
488 } // namespace dart | 488 } // namespace dart |
OLD | NEW |