Implement a MessageLoopForIO::WatchMxHandle API under Fuchsia

Desktop / Chromium - Wez [chromium.org] - 10 August 2017 02:29 EDT

WatchMxHandle() follows the design of the WatchFileDescriptor() API provided by MessageLoopForIO across the POSIX platforms, and now serves as the underlying implementation for watching file-descriptors under Fuchsia.

This will be used for asynchronous I/O on native Fuchsia primitives, e.g. in the Mojo IPC implementation, which will use Fuchsia "channels".

This CL also fixes the behaviour of StopWatchingFileDescriptor() from within an event callback, and an mxio leak arising from use of that API, and pulls in sergeyu's test for StopWatchingFileDescriptor(), from https://chromium-review.googlesource.com/c/608983

Bug: 706592, 740791 Change-Id: I675c5cfe8a443d48863361028c0f9222fdde8182 Reviewed-on: https://chromium-review.googlesource.com/602396 Commit-Queue: Wez

9a7c727 Implement a MessageLoopForIO::WatchMxHandle API under Fuchsia.
base/message_loop/message_loop.cc | 12 ++
base/message_loop/message_loop.h | 16 +-
.../message_loop/message_loop_io_posix_unittest.cc | 107 ++++++++++--
base/message_loop/message_pump_fuchsia.cc | 181 +++++++++++++++------
base/message_loop/message_pump_fuchsia.h | 116 ++++++++-----
5 files changed, 322 insertions(+), 110 deletions(-)

Upstream: git.chromium.org


  • Share