Revert "Have Device Service observe MessageLoop destruction"

This reverts commit 8e9dbcd3188c015f2dd67ba781168431aa51dab5.

Reason for revert: It turns out that this is not the right solution to the problem. crbug.com/856771 presents a crash that this CL introduces on ChromeOS: the Device Service instance is now shut down after the DBusThreadManager global instance, on which it implicitly depends. We'll have to be more precise about the timing of when the Device Service instance is destroyed, which will mean doing the plumbing that the below CL was looking to avoid. This is all sad-making, but c'est la vie.

Bug: 856771, 794105

Original change's description:
> 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}

TBR=rockot@chromium.org,blundell@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 794105
Change-Id: I6de862f5828560ea903855898e09322e9f8d1e6c
Reviewed-on: https://chromium-review.googlesource.com/1134887
Commit-Queue: Colin Blundell <blundell@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574603}
2 files changed