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

Issue 800523004: Dart: Simplifies the handle watcher. Various cleanups and bugfixes. (Closed)

Created:
6 years ago by zra
Modified:
5 years, 11 months ago
Reviewers:
siva, abarth-chromium
CC:
Aaron Boodman, ben+mojo_chromium.org, darin (slow to review), jamesr, mojo-reviews_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Base URL:
git@github.com:domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Dart: Simplifies the handle watcher. Various cleanups and bugfixes. This CL removes the TOGGLE_WRITE command from the Dart handle watcher. The listen function in the MojoHandle class also no longer wraps the callback in a closure that automatically adds the handle back to the watcher after an event has been handled. This was trying to be too clever. Instead, after handling an event, the callback must explicitly indicate the events the client is now interested in. To enable this approach, the handle watcher now also sends the set of signals that were listened for to the client on an event. Also: - Interface implementation functions now return a Future so that e.g. a request can be serviced by an Isolate or other async operation, and the Interface can immediately return to listening for events on the pipe. - Clients now set a meaningful request ID so that the right Completer for the response can be looked up in a Map. - Rewrites MojoHandleSignals. - Renames MojoHandle to MojoEventStream and RawMojoHandle to MojoHandle. BUG= R=abarth@chromium.org, asiva@google.com Committed: https://chromium.googlesource.com/external/mojo/+/6e3be6003da13efc3d7b68cb9dd10aadfc56c088

Patch Set 1 #

Total comments: 6

Patch Set 2 : #

Total comments: 7

Patch Set 3 : #

Patch Set 4 : Rename MojoHandle -> MojoEventStream #

Patch Set 5 : Merge #

Patch Set 6 : Add back some handle watcher pruning code #

Patch Set 7 : Add deps asked for by gn #

Patch Set 8 : cleanup #

Unified diffs Side-by-side diffs Delta from patch set Stats (+606 lines, -477 lines) Patch
M mojo/dart/embedder/BUILD.gn View 1 2 3 4 5 6 2 chunks +18 lines, -1 line 0 comments Download
M mojo/dart/embedder/test/BUILD.gn View 1 2 3 4 5 6 2 chunks +3 lines, -1 line 0 comments Download
M mojo/dart/embedder/test/dart_to_cpp_tests.cc View 1 chunk +1 line, -1 line 0 comments Download
M mojo/dart/embedder/test/dart_to_cpp_tests.dart View 1 2 3 4 5 2 chunks +4 lines, -6 lines 0 comments Download
M mojo/dart/test/bindings_generation_test.dart View 1 2 3 1 chunk +5 lines, -5 lines 0 comments Download
M mojo/dart/test/codec_test.dart View 1 2 3 3 chunks +6 lines, -6 lines 0 comments Download
M mojo/dart/test/core_test.dart View 1 2 3 4 10 chunks +20 lines, -23 lines 0 comments Download
M mojo/dart/test/handle_finalizer_test.dart View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
M mojo/dart/test/handle_watcher_test.dart View 1 2 3 4 chunks +29 lines, -27 lines 0 comments Download
M mojo/dart/test/interface_test.dart View 7 chunks +20 lines, -14 lines 0 comments Download
M mojo/dart/test/ping_pong_test.dart View 1 2 3 2 chunks +22 lines, -20 lines 0 comments Download
M mojo/dart/test/simple_handle_watcher_test.dart View 1 2 3 1 chunk +4 lines, -4 lines 0 comments Download
M mojo/public/dart/src/buffer.dart View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M mojo/public/dart/src/client.dart View 1 2 3 3 chunks +90 lines, -52 lines 0 comments Download
M mojo/public/dart/src/codec.dart View 1 2 3 7 chunks +25 lines, -21 lines 0 comments Download
M mojo/public/dart/src/data_pipe.dart View 1 2 3 5 chunks +10 lines, -8 lines 0 comments Download
M mojo/public/dart/src/handle.dart View 1 2 3 4 7 chunks +59 lines, -92 lines 0 comments Download
M mojo/public/dart/src/handle_watcher.dart View 1 2 3 4 5 6 7 12 chunks +92 lines, -88 lines 0 comments Download
M mojo/public/dart/src/interface.dart View 1 2 3 2 chunks +85 lines, -57 lines 0 comments Download
M mojo/public/dart/src/message_pipe.dart View 1 2 3 4 chunks +6 lines, -6 lines 0 comments Download
M mojo/public/dart/src/types.dart View 1 2 3 4 5 6 7 2 chunks +62 lines, -15 lines 0 comments Download
M mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl View 1 2 5 chunks +28 lines, -13 lines 0 comments Download
M mojo/public/tools/bindings/generators/dart_templates/struct_definition.tmpl View 1 chunk +1 line, -1 line 0 comments Download
M mojo/public/tools/bindings/generators/mojom_dart_generator.py View 1 2 3 1 chunk +10 lines, -10 lines 0 comments Download

Messages

Total messages: 17 (4 generated)
zra
Will add Mojo Team reviewer(s) when everyone is back after next week.
6 years ago (2014-12-23 18:01:38 UTC) #2
zra
+jamesr
5 years, 11 months ago (2014-12-29 21:19:35 UTC) #4
siva
lgtm https://codereview.chromium.org/800523004/diff/1/mojo/dart/test/handle_watcher_test.dart File mojo/dart/test/handle_watcher_test.dart (right): https://codereview.chromium.org/800523004/diff/1/mojo/dart/test/handle_watcher_test.dart#newcode29 mojo/dart/test/handle_watcher_test.dart:29: handle.enableWriteEvents(); Why does this have to be moved ...
5 years, 11 months ago (2014-12-29 23:20:44 UTC) #5
zra
https://codereview.chromium.org/800523004/diff/1/mojo/dart/test/handle_watcher_test.dart File mojo/dart/test/handle_watcher_test.dart (right): https://codereview.chromium.org/800523004/diff/1/mojo/dart/test/handle_watcher_test.dart#newcode29 mojo/dart/test/handle_watcher_test.dart:29: handle.enableWriteEvents(); On 2014/12/29 23:20:44, siva wrote: > Why does ...
5 years, 11 months ago (2014-12-30 16:29:33 UTC) #6
zra
+abarth in case he is back.
5 years, 11 months ago (2014-12-30 19:01:57 UTC) #8
jamesr
I don't think I'm able to provide a meaningful review of this patch.
5 years, 11 months ago (2014-12-30 22:17:40 UTC) #10
abarth-chromium
I'm not sure how you've been handling reviews while I've been out, but if you'd ...
5 years, 11 months ago (2015-01-04 08:46:07 UTC) #11
zra
James and Siva have been reviewing Dart CLs while you've been out. I've emailed you ...
5 years, 11 months ago (2015-01-05 15:45:42 UTC) #12
abarth-chromium
On 2015/01/05 at 15:45:42, zra wrote: > Maybe the following renaming could clear things up: ...
5 years, 11 months ago (2015-01-05 16:47:39 UTC) #13
zra
https://codereview.chromium.org/800523004/diff/20001/mojo/public/dart/src/handle.dart File mojo/public/dart/src/handle.dart (right): https://codereview.chromium.org/800523004/diff/20001/mojo/public/dart/src/handle.dart#newcode103 mojo/public/dart/src/handle.dart:103: [MojoHandleSignals signals = MojoHandleSignals.READABLE]) : On 2015/01/05 15:45:41, zra ...
5 years, 11 months ago (2015-01-05 21:22:31 UTC) #14
zra
Merged in Jim's change. PTAL.
5 years, 11 months ago (2015-01-08 22:07:06 UTC) #15
abarth-chromium
LGTM I can't shake the feeling that this code is doing too much. I still ...
5 years, 11 months ago (2015-01-09 02:50:21 UTC) #16
zra
5 years, 11 months ago (2015-01-09 16:54:08 UTC) #17
Message was sent while issue was closed.
Committed patchset #8 (id:140001) manually as
6e3be6003da13efc3d7b68cb9dd10aadfc56c088 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698