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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 137443008: Fix mac build breakage in dart_api_impl.cc (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 0873884ced1e29ba2f6c7da1d58a44476315d8e4..3683d21770cb9016648ee6753e8d0750a16a553c 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -1182,15 +1182,22 @@ DART_EXPORT Dart_Handle Dart_PostMessage(Dart_Handle send_port,
return Api::NewError("send_port is not a SendPort.");
}
const Object& idObj = Object::Handle(
- DartLibraryCalls::PortGetId(port_instance));
+ DartLibraryCalls::PortGetId(port_instance));
ASSERT(!idObj.IsError());
Integer& id = Integer::Handle();
id ^= idObj.raw();
Dart_Port port = static_cast<Dart_Port>(id.AsInt64Value());
- if (Dart_Post(port, object)) {
+ uint8_t* data = NULL;
+ MessageWriter writer(&data, &allocator);
+ Object& msg_object = Object::Handle(Api::UnwrapHandle(object));
+ writer.WriteMessage(msg_object);
+ intptr_t len = writer.BytesWritten();
+ bool r = PortMap::PostMessage(
+ new Message(port, data, len, Message::kNormalPriority));
+ if (r) {
return Api::Success();
}
- return Api::NewError("Dart_Post failed.");
+ return Api::NewError("Dart_PostMessage failed.");
}
// --- Scopes ----
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698