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

Unified Diff: sky/engine/bindings/mojo_natives.cc

Issue 1060193002: Provide mechanism to close immediately to Dart bindings (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 8 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 | « mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/bindings/mojo_natives.cc
diff --git a/sky/engine/bindings/mojo_natives.cc b/sky/engine/bindings/mojo_natives.cc
index 25faf767fdcd3be99c61814d5595457357400601..c67f71a771590b4cb2ec4ff00a74fe0a76746454 100644
--- a/sky/engine/bindings/mojo_natives.cc
+++ b/sky/engine/bindings/mojo_natives.cc
@@ -716,7 +716,7 @@ void MojoHandleWatcher_SendControlData(Dart_NativeArguments arguments) {
CHECK_INTEGER_ARGUMENT(arguments, 1, &client_handle, InvalidArgument);
Dart_Handle send_port_handle = Dart_GetNativeArgument(arguments, 2);
- Dart_Port send_port_id = 0;
+ Dart_Port send_port_id = ILLEGAL_PORT;
if (!Dart_IsNull(send_port_handle)) {
Dart_Handle result = Dart_SendPortGetId(send_port_handle, &send_port_id);
if (Dart_IsError(result)) {
@@ -755,7 +755,9 @@ void MojoHandleWatcher_RecvControlData(Dart_NativeArguments arguments) {
Dart_Handle list = Dart_NewList(3);
Dart_ListSetAt(list, 0, Dart_NewInteger(cd.handle));
- Dart_ListSetAt(list, 1, Dart_NewSendPort(cd.port));
+ if (cd.port != ILLEGAL_PORT) {
+ Dart_ListSetAt(list, 1, Dart_NewSendPort(cd.port));
+ }
Dart_ListSetAt(list, 2, Dart_NewInteger(cd.data));
Dart_SetReturnValue(arguments, list);
}
« no previous file with comments | « mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698