Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 9104041: Added API Dart_PostCMessage for posting a Dart_CMessage structure (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from asiva@ Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698