Fix hangs in Mandoline page cycler on Linux with --enable-multiprocess.

This was caused by content handlers sometimes dropping a request. The solution is to implement a simplified version of the two-phase shutdown used by apps. First, the ContentHandler implementation needs to keep a reference for the app's lifetime. Then every time StartApplication is called, a callback is passed along to be run when the content handler instance is destructed. When the ContentHandlerConnection notices that all the instances are deleted, it destructs itself. This releases the ContentHandler implementation which releases the app lifetime reference.

BUG=544153, 478251

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

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


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