Ensure that in-flight message pipes are always closed and the other end is notified.

This was exposed by the three tests below when the new EDK was switched on for the test target. The problem is we have the following three pairs of ports:
A <> B
C <> D
E <> F

A is sent over C and then C is sent over E. C is closed immediately after it's recieved. Before this fix, A was not recieved (i.e. TransportData::DeserializeDispatchers wasn't called for it). As a result, B never received a peer closed notification so its error handler was never called.

The fix is to ensure that when a message pipe is closed it asks its peer to close instead. That way by the time the notification is received from the peer that it's been closed we can ensure that all in-flight messages are dispatched.

BUG=561803
TEST=mojo_shell_unittests --gtest_filter=AboutFetcherTest.AboutBlank:ApplicationManagerTest.TestEndApplicationClosure:AboutFetcherTest.UnrecognizedURL

Review URL: https://codereview.chromium.org/1554623005

Cr-Commit-Position: refs/heads/master@{#367168}


CrOS-Libchrome-Original-Commit: 277a2fa76b238c46af6cc98eba54296b82423415
4 files changed
tree: 173b322d842df0a6c1c198f65a21dea54db4c52a
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/