|
Mojo: Armed Watchers
Changes the Watcher C API as described in this post:
https://groups.google.com/a/chromium.org/forum/#!topic/chromium-mojo/UcA97R4IznI
Makes watchers a first-class non-transferable handle type in Mojo,
allows multiple distinct events to be watched by a single watcher,
and requires watchers to be explicitly armed before a notification
will fire. Also now allows for cancellation (and watcher closure)
from within notification callbacks, simplifying cancellation logic
and avoiding any possibility of EDK deadlocks caused by cancellations,
during watch notification.
Updates the Watcher class in mojo/public/cpp/system to reflect the
new model, adding an explicit ArmingPolicy to allow users to select
manual or automatic arming. Also renames it to SimpleWatcher to
adequately convey that this is only a simplified helper class that
does not utilize the full power of watchers.
Automatic arming provides imperfect edge-triggered behavior, which is
still an improvement over the old behavior in many cases.
Manual arming is used in the bindings Connector to ensure that all
messages are flushed from a pipe before control returns from a
handle-ready notification, and is also now used for Watchers which
watch a data pipe handle.
Other users of the Watcher C API (namely Blink's MojoWatcher and
content's MessagePort) have also been adapted to the new API.
BUG= 693595, 700171
Review-Url: https://codereview.chromium.org/2725133002
Cr-Commit-Position: refs/heads/master@{#457269}
Committed: https://chromium.googlesource.com/chromium/src/+/9eadabae1de0cb22725450596fe324f03dd63b92
Total comments: 18
Total comments: 2
Total comments: 16
Total comments: 8
Total comments: 6
Total comments: 2
Total comments: 2
Total comments: 2
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+3976 lines, -1565 lines) |
Patch |
|
M |
chrome/browser/media/cast_remoting_sender.h
|
View
|
1
2
3
4
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
chrome/browser/media/cast_remoting_sender.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
|
4 chunks |
+12 lines, -7 lines |
0 comments
|
Download
|
|
M |
content/browser/loader/mojo_async_resource_handler.h
|
View
|
1
2
3
4
5
6
7
8
9
10
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/browser/loader/mojo_async_resource_handler.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
3 chunks |
+9 lines, -3 lines |
0 comments
|
Download
|
|
M |
content/browser/shared_worker/shared_worker_service_impl_unittest.cc
|
View
|
1
2
3
|
2 chunks |
+4 lines, -6 lines |
0 comments
|
Download
|
|
M |
content/child/url_response_body_consumer.h
|
View
|
1
2
3
4
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/child/url_response_body_consumer.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
4 chunks |
+12 lines, -12 lines |
0 comments
|
Download
|
|
M |
content/child/web_data_consumer_handle_impl.h
|
View
|
1
2
3
4
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/child/web_data_consumer_handle_impl.cc
|
View
|
1
2
3
4
|
2 chunks |
+4 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/common/message_port.h
|
View
|
1
2
3
4
|
2 chunks |
+13 lines, -4 lines |
0 comments
|
Download
|
|
M |
content/common/message_port.cc
|
View
|
1
2
3
4
|
2 chunks |
+68 lines, -20 lines |
0 comments
|
Download
|
|
M |
ios/web/webui/mojo_facade.h
|
View
|
1
2
3
4
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
ios/web/webui/mojo_facade.mm
|
View
|
1
2
3
4
|
1 chunk |
+4 lines, -3 lines |
0 comments
|
Download
|
|
M |
ios/web/webui/mojo_facade_unittest.mm
|
View
|
1
2
3
4
5
6
|
1 chunk |
+12 lines, -0 lines |
0 comments
|
Download
|
|
M |
ios/web/webui/web_ui_mojo_inttest.mm
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
2 chunks |
+11 lines, -1 line |
0 comments
|
Download
|
|
M |
ipc/ipc_sync_channel.h
|
View
|
1
2
3
4
|
3 chunks |
+2 lines, -3 lines |
0 comments
|
Download
|
|
M |
ipc/ipc_sync_channel.cc
|
View
|
1
2
3
4
5
|
9 chunks |
+18 lines, -17 lines |
0 comments
|
Download
|
|
M |
media/mojo/common/mojo_decoder_buffer_converter.h
|
View
|
1
2
3
4
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
media/mojo/common/mojo_decoder_buffer_converter.cc
|
View
|
1
2
3
4
|
4 chunks |
+27 lines, -17 lines |
0 comments
|
Download
|
|
M |
media/remoting/demuxer_stream_adapter.h
|
View
|
1
2
3
4
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
media/remoting/demuxer_stream_adapter.cc
|
View
|
1
2
3
4
|
3 chunks |
+11 lines, -8 lines |
0 comments
|
Download
|
|
M |
mojo/android/javatests/src/org/chromium/mojo/system/impl/WatcherImplTest.java
|
View
|
1
2
3
4
5
6
7
8
9
10
|
3 chunks |
+17 lines, -1 line |
0 comments
|
Download
|
|
M |
mojo/android/system/watcher_impl.cc
|
View
|
1
2
3
4
|
4 chunks |
+4 lines, -5 lines |
0 comments
|
Download
|
|
M |
mojo/common/data_pipe_drainer.h
|
View
|
1
2
3
4
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
mojo/common/data_pipe_drainer.cc
|
View
|
1
2
3
4
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
mojo/edk/embedder/entrypoints.cc
|
View
|
1
2
3
|
2 chunks |
+21 lines, -5 lines |
0 comments
|
Download
|
|
M |
mojo/edk/js/drain_data.h
|
View
|
1
2
3
4
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
mojo/edk/js/drain_data.cc
|
View
|
1
2
3
4
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
mojo/edk/js/waiting_callback.h
|
View
|
1
2
3
4
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
mojo/edk/js/waiting_callback.cc
|
View
|
1
2
3
4
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
mojo/edk/system/BUILD.gn
|
View
|
1
2
3
|
2 chunks |
+5 lines, -3 lines |
0 comments
|
Download
|
|
M |
mojo/edk/system/awakable_list.h
|
View
|
|
3 chunks |
+0 lines, -13 lines |
0 comments
|
Download
|
|
M |
mojo/edk/system/awakable_list.cc
|
View
|
|
3 chunks |
+0 lines, -13 lines |
0 comments
|
Download
|
|
M |
mojo/edk/system/core.h
|
View
|
1
2
3
4
5
6
7
8
9
10
|
2 chunks |
+11 lines, -3 lines |
0 comments
|
Download
|
|
M |
mojo/edk/system/core.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
3 chunks |
+35 lines, -17 lines |
0 comments
|
Download
|
|
M |
mojo/edk/system/data_pipe_consumer_dispatcher.h
|
View
|
1
2
3
4
5
6
7
8
9
10
|
4 chunks |
+6 lines, -4 lines |
0 comments
|
Download
|
|
M |
mojo/edk/system/data_pipe_consumer_dispatcher.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
|
13 chunks |
+46 lines, -26 lines |
0 comments
|
Download
|
|
M |
mojo/edk/system/data_pipe_producer_dispatcher.h
|
View
|
1
2
3
9
10
|
4 chunks |
+6 lines, -4 lines |
0 comments
|
Download
|
|
M |
mojo/edk/system/data_pipe_producer_dispatcher.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
10 chunks |
+35 lines, -26 lines |
0 comments
|
Download
|
|
M |
mojo/edk/system/data_pipe_unittest.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
3 chunks |
+11 lines, -7 lines |
0 comments
|
Download
|
|
M |
mojo/edk/system/dispatcher.h
|
View
|
1
2
3
|
4 chunks |
+22 lines, -6 lines |
0 comments
|
Download
|
|
M |
mojo/edk/system/dispatcher.cc
|
View
|
1
2
3
|
3 chunks |
+21 lines, -3 lines |
0 comments
|
Download
|
|
M |
mojo/edk/system/message_pipe_dispatcher.h
|
View
|
1
2
3
|
4 chunks |
+6 lines, -4 lines |
0 comments
|
Download
|
|
M |
mojo/edk/system/message_pipe_dispatcher.cc
|
View
|
1
2
3
|
10 chunks |
+41 lines, -24 lines |
0 comments
|
Download
|
|
M |
mojo/edk/system/multiprocess_message_pipe_unittest.cc
|
View
|
1
2
3
4
|
2 chunks |
+10 lines, -8 lines |
0 comments
|
Download
|
|
M |
mojo/edk/system/request_context.h
|
View
|
1
2
3
4
|
2 chunks |
+15 lines, -14 lines |
0 comments
|
Download
|
|
M |
mojo/edk/system/request_context.cc
|
View
|
1
2
3
4
5
|
3 chunks |
+30 lines, -24 lines |
0 comments
|
Download
|
|
A |
mojo/edk/system/watch.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1 chunk |
+124 lines, -0 lines |
0 comments
|
Download
|
|
A |
mojo/edk/system/watch.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+83 lines, -0 lines |
0 comments
|
Download
|
|
M |
mojo/edk/system/watch_unittest.cc
|
View
|
1
2
3
|
1 chunk |
+0 lines, -480 lines |
0 comments
|
Download
|
|
M |
mojo/edk/system/watcher.h
|
View
|
1
2
3
|
1 chunk |
+0 lines, -88 lines |
0 comments
|
Download
|
|
M |
mojo/edk/system/watcher.cc
|
View
|
1
2
3
|
1 chunk |
+0 lines, -53 lines |
0 comments
|
Download
|
|
A |
mojo/edk/system/watcher_dispatcher.h
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+91 lines, -0 lines |
0 comments
|
Download
|
|
A |
mojo/edk/system/watcher_dispatcher.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+219 lines, -0 lines |
0 comments
|
Download
|
|
M |
mojo/edk/system/watcher_set.h
|
View
|
1
2
3
|
1 chunk |
+36 lines, -19 lines |
0 comments
|
Download
|
|
M |
mojo/edk/system/watcher_set.cc
|
View
|
1
2
3
|
1 chunk |
+49 lines, -24 lines |
0 comments
|
Download
|
|
A |
mojo/edk/system/watcher_unittest.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
|
1 chunk |
+1590 lines, -0 lines |
0 comments
|
Download
|
|
M |
mojo/public/c/system/BUILD.gn
|
View
|
1
2
3
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
mojo/public/c/system/core.h
|
View
|
1
2
3
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
mojo/public/c/system/functions.h
|
View
|
1
2
3
|
2 chunks |
+0 lines, -76 lines |
0 comments
|
Download
|
|
M |
mojo/public/c/system/thunks.h
|
View
|
1
2
3
|
2 chunks |
+14 lines, -25 lines |
0 comments
|
Download
|
|
M |
mojo/public/c/system/thunks.cc
|
View
|
1
2
3
|
1 chunk |
+21 lines, -5 lines |
0 comments
|
Download
|
|
M |
mojo/public/c/system/types.h
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+14 lines, -13 lines |
0 comments
|
Download
|
|
A |
mojo/public/c/system/watcher.h
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+183 lines, -0 lines |
0 comments
|
Download
|
|
M |
mojo/public/cpp/bindings/binding.h
|
View
|
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
|
M |
mojo/public/cpp/bindings/connector.h
|
View
|
1
2
3
4
|
4 chunks |
+11 lines, -3 lines |
0 comments
|
Download
|
|
M |
mojo/public/cpp/bindings/interface_ptr.h
|
View
|
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
|
M |
mojo/public/cpp/bindings/lib/binding_state.h
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
mojo/public/cpp/bindings/lib/binding_state.cc
|
View
|
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
|
M |
mojo/public/cpp/bindings/lib/connector.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
6 chunks |
+43 lines, -9 lines |
0 comments
|
Download
|
|
M |
mojo/public/cpp/bindings/lib/interface_ptr_state.h
|
View
|
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
|
M |
mojo/public/cpp/bindings/lib/multiplex_router.h
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
mojo/public/cpp/bindings/lib/multiplex_router.cc
|
View
|
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
|
M |
mojo/public/cpp/bindings/tests/connector_unittest.cc
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
mojo/public/cpp/system/BUILD.gn
|
View
|
1
2
3
4
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
A |
mojo/public/cpp/system/simple_watcher.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
1 chunk |
+211 lines, -0 lines |
0 comments
|
Download
|
|
A |
mojo/public/cpp/system/simple_watcher.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1 chunk |
+273 lines, -0 lines |
0 comments
|
Download
|
|
M |
mojo/public/cpp/system/tests/BUILD.gn
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
A |
mojo/public/cpp/system/tests/simple_watcher_unittest.cc
|
View
|
1
2
3
4
|
1 chunk |
+277 lines, -0 lines |
0 comments
|
Download
|
|
M |
mojo/public/cpp/system/tests/watcher_unittest.cc
|
View
|
1
2
3
4
|
1 chunk |
+0 lines, -181 lines |
0 comments
|
Download
|
|
M |
mojo/public/cpp/system/watcher.h
|
View
|
1
2
3
4
5
|
1 chunk |
+15 lines, -103 lines |
0 comments
|
Download
|
|
M |
mojo/public/cpp/system/watcher.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+7 lines, -104 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/mojo/MojoWatcher.h
|
View
|
1
2
3
5
6
7
8
9
10
11
12
13
14
15
|
2 chunks |
+4 lines, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/mojo/MojoWatcher.cpp
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
4 chunks |
+103 lines, -41 lines |
0 comments
|
Download
|
Dependent Patchsets:
Total messages: 172 (135 generated)
|