| 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 | 6 |
| 7 #include "vm/dart_api_impl.h" | 7 #include "vm/dart_api_impl.h" |
| 8 #include "vm/exceptions.h" | 8 #include "vm/exceptions.h" |
| 9 #include "vm/message.h" | 9 #include "vm/message.h" |
| 10 #include "vm/native_entry.h" | 10 #include "vm/native_entry.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 const Integer& port_int = Integer::Handle(Integer::New(port_id)); | 56 const Integer& port_int = Integer::Handle(Integer::New(port_id)); |
| 57 ASSERT(!port_int.IsNull()); | 57 ASSERT(!port_int.IsNull()); |
| 58 const SendPort& send_port = SendPort::Handle(SendPort::New(port_id)); | 58 const SendPort& send_port = SendPort::Handle(SendPort::New(port_id)); |
| 59 const String& name = String::Handle(String::New(isolate->name())); | 59 const String& name = String::Handle(String::New(isolate->name())); |
| 60 ASSERT(!name.IsNull()); | 60 ASSERT(!name.IsNull()); |
| 61 const Array& args = Array::Handle(Array::New(3)); | 61 const Array& args = Array::Handle(Array::New(3)); |
| 62 ASSERT(!args.IsNull()); | 62 ASSERT(!args.IsNull()); |
| 63 args.SetAt(0, port_int); | 63 args.SetAt(0, port_int); |
| 64 args.SetAt(1, send_port); | 64 args.SetAt(1, send_port); |
| 65 args.SetAt(2, name); | 65 args.SetAt(2, name); |
| 66 Object& r = Object::Handle(service_isolate_->current_zone()); | 66 const Object& r = Object::Handle( |
| 67 r = DartEntry::InvokeFunction(register_function_, args); | 67 DartEntry::InvokeFunction(register_function_, args)); |
| 68 if (FLAG_trace_service) { | 68 if (FLAG_trace_service) { |
| 69 OS::Print("vm-service: Isolate %s %" Pd64 " registered.\n", | 69 OS::Print("vm-service: Isolate %s %" Pd64 " registered.\n", |
| 70 name.ToCString(), | 70 name.ToCString(), |
| 71 port_id); | 71 port_id); |
| 72 } | 72 } |
| 73 ASSERT(!r.IsError()); | 73 ASSERT(!r.IsError()); |
| 74 } | 74 } |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 Function& register_function_; | 77 Function& register_function_; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 Service::CancelStream(stream_id.ToCString()); | 145 Service::CancelStream(stream_id.ToCString()); |
| 146 return Object::null(); | 146 return Object::null(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 | 149 |
| 150 DEFINE_NATIVE_ENTRY(VMService_RequestAssets, 0) { | 150 DEFINE_NATIVE_ENTRY(VMService_RequestAssets, 0) { |
| 151 return Service::RequestAssets(); | 151 return Service::RequestAssets(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 } // namespace dart | 154 } // namespace dart |
| OLD | NEW |