| 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 "include/dart_api.h" | 5 #include "include/dart_api.h" |
| 6 #include "include/dart_mirrors_api.h" | 6 #include "include/dart_mirrors_api.h" |
| 7 #include "include/dart_native_api.h" | 7 #include "include/dart_native_api.h" |
| 8 | 8 |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
| (...skipping 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1569 void* new_ptr = realloc(reinterpret_cast<void*>(ptr), new_size); | 1569 void* new_ptr = realloc(reinterpret_cast<void*>(ptr), new_size); |
| 1570 return reinterpret_cast<uint8_t*>(new_ptr); | 1570 return reinterpret_cast<uint8_t*>(new_ptr); |
| 1571 } | 1571 } |
| 1572 | 1572 |
| 1573 | 1573 |
| 1574 DART_EXPORT bool Dart_Post(Dart_Port port_id, Dart_Handle handle) { | 1574 DART_EXPORT bool Dart_Post(Dart_Port port_id, Dart_Handle handle) { |
| 1575 Isolate* isolate = Isolate::Current(); | 1575 Isolate* isolate = Isolate::Current(); |
| 1576 DARTSCOPE(isolate); | 1576 DARTSCOPE(isolate); |
| 1577 const Object& object = Object::Handle(isolate, Api::UnwrapHandle(handle)); | 1577 const Object& object = Object::Handle(isolate, Api::UnwrapHandle(handle)); |
| 1578 uint8_t* data = NULL; | 1578 uint8_t* data = NULL; |
| 1579 MessageWriter writer(&data, &allocator); | 1579 MessageWriter writer(&data, &allocator, false); |
| 1580 writer.WriteMessage(object); | 1580 writer.WriteMessage(object); |
| 1581 intptr_t len = writer.BytesWritten(); | 1581 intptr_t len = writer.BytesWritten(); |
| 1582 return PortMap::PostMessage(new Message( | 1582 return PortMap::PostMessage(new Message( |
| 1583 port_id, data, len, Message::kNormalPriority)); | 1583 port_id, data, len, Message::kNormalPriority)); |
| 1584 } | 1584 } |
| 1585 | 1585 |
| 1586 | 1586 |
| 1587 DART_EXPORT Dart_Handle Dart_NewSendPort(Dart_Port port_id) { | 1587 DART_EXPORT Dart_Handle Dart_NewSendPort(Dart_Port port_id) { |
| 1588 Isolate* isolate = Isolate::Current(); | 1588 Isolate* isolate = Isolate::Current(); |
| 1589 DARTSCOPE(isolate); | 1589 DARTSCOPE(isolate); |
| (...skipping 3834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5424 | 5424 |
| 5425 | 5425 |
| 5426 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( | 5426 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( |
| 5427 const char* name, | 5427 const char* name, |
| 5428 Dart_ServiceRequestCallback callback, | 5428 Dart_ServiceRequestCallback callback, |
| 5429 void* user_data) { | 5429 void* user_data) { |
| 5430 Service::RegisterRootEmbedderCallback(name, callback, user_data); | 5430 Service::RegisterRootEmbedderCallback(name, callback, user_data); |
| 5431 } | 5431 } |
| 5432 | 5432 |
| 5433 } // namespace dart | 5433 } // namespace dart |
| OLD | NEW |