Remove DeviceMonitorLinux::WillDestroyCurrentMessageLoop().
The FILE thread will soon be migrated to TaskScheduler which doesn't
support MessageLoop destruction observers.
DeviceMonitorLinux::WillDestroyCurrentMessageLoop() notified 3 observers
that the DeviceMonitorLinux MessageLoop was being destroyed. Each
observer used this notification to destroy itself.
- InputServiceLinuxImpl: This is now a leaky LazyInstance which is
never destroyed.
- HidServiceLinux::FileThreadHelper: This is now destroyed by posting
a delete task to the FILE thread when HidServiceLinux::Shutdown is
called. HidServiceLinux::Shutdown is called from
BrowserProcessImpl::StartTearDown() which is called before the
FILE thread is teared down.
- UsbServiceLinux::FileThreadHelper: Same pattern as
HidServiceLinux::FileThreadHelper.
BUG=650723
Review-Url: https://codereview.chromium.org/2482463002
Cr-Commit-Position: refs/heads/master@{#431564}
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 30665042..673377e 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -305,11 +305,12 @@
// so it needs to be shut down before the ProfileManager.
supervised_user_whitelist_installer_.reset();
-#if !defined(OS_ANDROID)
// Debugger must be cleaned up before ProfileManager.
remote_debugging_server_.reset();
devtools_auto_opener_.reset();
-#endif
+
+ // ChromeDeviceClient must be shutdown when the FILE thread is still alive.
+ device_client_->Shutdown();
// Need to clear profiles (download managers) before the io_thread_.
{