diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-23 19:42:33 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-23 19:42:33 +0000 |
commit | 91451171aa98b6e44238517f39fc58a86028d75d (patch) | |
tree | a67533d2bffddf114314e8e7235a5591c21233b7 /chrome/browser/child_process_launcher.cc | |
parent | 3a4f359fc1413e816423d137e7dc67abd8db5921 (diff) | |
download | chromium_src-91451171aa98b6e44238517f39fc58a86028d75d.zip chromium_src-91451171aa98b6e44238517f39fc58a86028d75d.tar.gz chromium_src-91451171aa98b6e44238517f39fc58a86028d75d.tar.bz2 |
Fix bug when accessing g_browser_process->broker_services() at shutdown.
BUG=28501
Review URL: http://codereview.chromium.org/435001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32832 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/child_process_launcher.cc')
-rw-r--r-- | chrome/browser/child_process_launcher.cc | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/chrome/browser/child_process_launcher.cc b/chrome/browser/child_process_launcher.cc index b7933c6..73cc9dc 100644 --- a/chrome/browser/child_process_launcher.cc +++ b/chrome/browser/child_process_launcher.cc @@ -5,7 +5,6 @@ #include "chrome/browser/child_process_launcher.h" #include "base/command_line.h" -#include "base/lazy_instance.h" #include "base/logging.h" #include "base/scoped_ptr.h" #include "base/thread.h" @@ -28,16 +27,6 @@ #include "base/global_descriptors_posix.h" #endif -namespace { - -class LauncherThread : public base::Thread { - public: - LauncherThread() : base::Thread("LauncherThread") { } -}; - -static base::LazyInstance<LauncherThread> launcher(base::LINKER_INITIALIZED); -} - // Having the functionality of ChildProcessLauncher be in an internal // ref counted object allows us to automatically terminate the process when the // parent class destructs, while still holding on to state that we need. @@ -64,11 +53,9 @@ class ChildProcessLauncher::Context client_ = client; CHECK(ChromeThread::GetCurrentThreadIdentifier(&client_thread_id_)); - if (!launcher.Get().message_loop()) - launcher.Get().Start(); - launcher.Get().message_loop()->PostTask( - FROM_HERE, + ChromeThread::PostTask( + ChromeThread::PROCESS_LAUNCHER, FROM_HERE, NewRunnableMethod( this, &Context::LaunchInternal, @@ -209,8 +196,8 @@ class ChildProcessLauncher::Context // On Posix, EnsureProcessTerminated can lead to 2 seconds of sleep! So // don't this on the UI/IO threads. - launcher.Get().message_loop()->PostTask( - FROM_HERE, + ChromeThread::PostTask( + ChromeThread::PROCESS_LAUNCHER, FROM_HERE, NewRunnableFunction( &ChildProcessLauncher::Context::TerminateInternal, #if defined(OS_LINUX) |