commit | 8e9dbcd3188c015f2dd67ba781168431aa51dab5 | [log] [tgz] |
---|---|---|
author | Colin Blundell <blundell@chromium.org> | Thu Jun 14 14:47:43 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Thu Jun 14 14:47:43 2018 |
tree | 4a4eafd6c6a1827d17271d0dc987435f4a37c7d7 | |
parent | 486ead8398efa5552e0137cd8ee3fc9a5280c6fc [diff] |
Have Device Service observe MessageLoop destruction The Device Service needs to clean up parts of its internal state as part of browser shutdown. However, it also needs to run on the UI thread, and embedded services that run on the UI thread are not guaranteed to be destroyed as part of browser shutdown (tasks to destroy these services are posted from the IO thread by ServiceManagerConnectionImpl::ShutDownOnIOThread, but the UI thread is typically shut down before these posted tasks are run). To solve this issue we discussed adding plumbing wherein embedded services could inform //content that they wanted to be notified when shutdown was occurring on the main thread. However, on investigation this plumbing would be painful to implement: it is only EmbeddedInstanceManager that has direct information of these service instances, and that object lives far away from //content's ServiceManagerContext, the object that knows when shutdown is occurring on the main thread. This CL takes an alternative approach of having the Device Service implementation observe the destruction of its MessageLoop. I have verified that the observation is triggered on shutdown of Chrome. Bug: 794105 Change-Id: I3b383871679d42f544812be4bcb13c872cf276ff Reviewed-on: https://chromium-review.googlesource.com/1099245 Commit-Queue: Colin Blundell <blundell@chromium.org> Reviewed-by: Ken Rockot <rockot@chromium.org> Cr-Commit-Position: refs/heads/master@{#567260}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .