Reviewers: yzshen1
CL:
https://codereview.chromium.org/2725133002/Message:
PTAL - Looks like I have some red to fix, but the CL is pretty large so I wanted
to send it out. Please look at EDK changes, public cpp watcher changes, and
bindings changes. Thanks!
Description:
Mojo: Armed Watchers
Changes the Watcher C API as described in this post:
https://groups.google.com/a/chromium.org/forum/#!topic/chromium-mojo/UcA97R4IznIUpdates 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.
Automatic arming provides imperfect edge-triggered behavior, which is
still an improvement over the old behavior. All existing Watcher users
use this behavior except for the bindings Connector.
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.
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
Affected files (+1022, -404 lines):
M chrome/browser/media/cast_remoting_sender.cc
M content/browser/loader/mojo_async_resource_handler.cc
M content/child/url_response_body_consumer.cc
M content/child/web_data_consumer_handle_impl.cc
M content/common/message_port.h
M content/common/message_port.cc
M ios/web/webui/
mojo_facade.mm M ipc/ipc_sync_channel.cc
M media/mojo/common/mojo_decoder_buffer_converter.cc
M media/remoting/demuxer_stream_adapter.cc
M mojo/android/system/watcher_impl.cc
M mojo/common/data_pipe_drainer.cc
M mojo/edk/embedder/entrypoints.cc
M mojo/edk/js/drain_data.cc
M mojo/edk/js/waiting_callback.cc
M mojo/edk/system/awakable_list.h
M mojo/edk/system/awakable_list.cc
M mojo/edk/system/core.h
M mojo/edk/system/core.cc
M mojo/edk/system/data_pipe_consumer_dispatcher.h
M mojo/edk/system/data_pipe_consumer_dispatcher.cc
M mojo/edk/system/data_pipe_producer_dispatcher.h
M mojo/edk/system/data_pipe_producer_dispatcher.cc
M mojo/edk/system/data_pipe_unittest.cc
M mojo/edk/system/dispatcher.h
M mojo/edk/system/dispatcher.cc
M mojo/edk/system/message_pipe_dispatcher.h
M mojo/edk/system/message_pipe_dispatcher.cc
M mojo/edk/system/multiprocess_message_pipe_unittest.cc
M mojo/edk/system/watch_unittest.cc
M mojo/edk/system/watcher.h
M mojo/edk/system/watcher.cc
M mojo/edk/system/watcher_set.h
M mojo/edk/system/watcher_set.cc
M mojo/public/c/system/functions.h
M mojo/public/c/system/thunks.h
M mojo/public/c/system/thunks.cc
M mojo/public/c/system/types.h
M mojo/public/cpp/bindings/BUILD.gn
M mojo/public/cpp/bindings/binding.h
M mojo/public/cpp/bindings/connector.h
M mojo/public/cpp/bindings/interface_ptr.h
M mojo/public/cpp/bindings/lib/binding_state.h
M mojo/public/cpp/bindings/lib/binding_state.cc
M mojo/public/cpp/bindings/lib/connector.cc
A mojo/public/cpp/bindings/lib/destruction_tracker.h
A mojo/public/cpp/bindings/lib/destruction_tracker.cc
M mojo/public/cpp/bindings/lib/interface_ptr_state.h
M mojo/public/cpp/bindings/lib/multiplex_router.h
M mojo/public/cpp/bindings/lib/multiplex_router.cc
M mojo/public/cpp/bindings/tests/binding_set_unittest.cc
M mojo/public/cpp/bindings/tests/connector_unittest.cc
M mojo/public/cpp/system/tests/watcher_unittest.cc
M mojo/public/cpp/system/watcher.h
M mojo/public/cpp/system/watcher.cc
M third_party/WebKit/Source/core/mojo/MojoWatcher.h
M third_party/WebKit/Source/core/mojo/MojoWatcher.cpp