From ee061ddf2860d8f2b0ba37898cf8ebebed61db87 Mon Sep 17 00:00:00 2001 From: John McCutchan Date: Tue, 7 Apr 2015 12:59:58 -0700 Subject: [PATCH] - Rename "nodefer" to "immediate" (gets rid of double negative in "nodefer: false"). - Immediate close means that anything pending will be discarded. - Plumb immediate all the way down to the handle watcher close call. - When an EventStream is closed because no one is listening for events, close immediately. - Don't call Dart_NewSendPort with ILLEGAL_PORT in sky embedder. - Bump DEPS to include fixes for Dart_NewSendPort and profiler signal handler executing after shared object is unloaded. - Fixes https://github.com/domokit/mojo/issues/79 R=zra@google.com Review URL: https://codereview.chromium.org/1060193002 --- engine/bindings/mojo_natives.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/engine/bindings/mojo_natives.cc b/engine/bindings/mojo_natives.cc index 25faf767fdc..c67f71a7715 100644 --- a/engine/bindings/mojo_natives.cc +++ b/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); }