Index: runtime/vm/dart_api_impl.cc |
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc |
index b23cdb0242af685df616292a2cbd90d08f7a1bc9..3108b60e6eafc114fe69ea04528a768917e0f10f 100644 |
--- a/runtime/vm/dart_api_impl.cc |
+++ b/runtime/vm/dart_api_impl.cc |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
// for details. All rights reserved. Use of this source code is governed by a |
// BSD-style license that can be found in the LICENSE file. |
@@ -730,6 +730,18 @@ DART_EXPORT bool Dart_PostIntArray(Dart_Port port_id, |
} |
+DART_EXPORT bool Dart_PostCObject(Dart_Port port_id, Dart_CObject* root) { |
+ uint8_t* buffer = NULL; |
+ MessageWriter writer(&buffer, allocator); |
+ |
+ writer.WriteCMessage(root); |
+ |
+ // Post the message at the given port. |
+ return PortMap::PostMessage(new Message( |
+ port_id, Message::kIllegalPort, buffer, Message::kNormalPriority)); |
+} |
+ |
+ |
DART_EXPORT bool Dart_Post(Dart_Port port_id, Dart_Handle handle) { |
Isolate* isolate = Isolate::Current(); |
CHECK_ISOLATE(isolate); |