| 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/service_isolate.h" | 5 #include "vm/service_isolate.h" |
| 6 | 6 |
| 7 #include "vm/compiler.h" | 7 #include "vm/compiler.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/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 | 212 |
| 213 // Set the type of the OOB message. | 213 // Set the type of the OOB message. |
| 214 message.SetAt(0, Smi::Handle(isolate, Smi::New(Message::kServiceOOBMsg))); | 214 message.SetAt(0, Smi::Handle(isolate, Smi::New(Message::kServiceOOBMsg))); |
| 215 | 215 |
| 216 // Serialize message. | 216 // Serialize message. |
| 217 uint8_t* data = NULL; | 217 uint8_t* data = NULL; |
| 218 MessageWriter writer(&data, &allocator, false); | 218 MessageWriter writer(&data, &allocator, false); |
| 219 writer.WriteMessage(message); | 219 writer.WriteMessage(message); |
| 220 | 220 |
| 221 // TODO(turnidge): Throw an exception when the return value is false? | 221 // TODO(turnidge): Throw an exception when the return value is false? |
| 222 PortMap::PostMessage(new Message(sp.Id(), data, writer.BytesWritten(), | 222 bool result = PortMap::PostMessage( |
| 223 Message::kOOBPriority)); | 223 new Message(sp.Id(), data, writer.BytesWritten(), |
| 224 Message::kOOBPriority)); |
| 225 arguments->SetReturn(Bool::Get(result)); |
| 224 } | 226 } |
| 225 | 227 |
| 226 static void SendRootServiceMessage(Dart_NativeArguments args) { | 228 static void SendRootServiceMessage(Dart_NativeArguments args) { |
| 227 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); | 229 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); |
| 228 Isolate* isolate = arguments->isolate(); | 230 Isolate* isolate = arguments->isolate(); |
| 229 StackZone zone(isolate); | 231 StackZone zone(isolate); |
| 230 HANDLESCOPE(isolate); | 232 HANDLESCOPE(isolate); |
| 231 GET_NON_NULL_NATIVE_ARGUMENT(Array, message, arguments->NativeArgAt(0)); | 233 GET_NON_NULL_NATIVE_ARGUMENT(Array, message, arguments->NativeArgAt(0)); |
| 232 Service::HandleRootMessage(message); | 234 Service::HandleRootMessage(message); |
| 233 } | 235 } |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 return result; | 679 return result; |
| 678 } | 680 } |
| 679 Dart_Handle source = GetSource(url_string); | 681 Dart_Handle source = GetSource(url_string); |
| 680 if (Dart_IsError(source)) { | 682 if (Dart_IsError(source)) { |
| 681 return source; | 683 return source; |
| 682 } | 684 } |
| 683 return Dart_LoadSource(library, url, source, 0, 0); | 685 return Dart_LoadSource(library, url, source, 0, 0); |
| 684 } | 686 } |
| 685 | 687 |
| 686 } // namespace dart | 688 } // namespace dart |
| OLD | NEW |