Use BrowserThreadMessageLoopProxy to post messages to
watched browser thread.
Store away thread_id using Debug::Alias so that optimizer doesn't
optimize away the code so that we can see the thread_id that is
hung from the crash dumps in windbg.
Stop the WatchDog thread before stopping other threads to see if
it fixes the racy condition duriong shutdown.
BUG=83564, 86818, 89141, 83343, 83430
TEST=ThreadWatcher unit tests
R=jar
Review URL: http://codereview.chromium.org/7218030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92588 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index ca2f048b..21d502e 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -225,6 +225,9 @@
// processes so this has to happen before stopping the IO thread.
GpuProcessHostUIShim::DestroyAll();
+ // Stop the watchdog thread before stopping other threads.
+ watchdog_thread_.reset();
+
// Need to stop io_thread_ before resource_dispatcher_host_, since
// io_thread_ may still deref ResourceDispatcherHost and handle resource
// request before going away.
@@ -267,9 +270,6 @@
// Now OK to destroy NotificationService.
main_notification_service_.reset();
- // Stop the watchdog thread after stopping other threads.
- watchdog_thread_.reset();
-
g_browser_process = NULL;
}