Chromium Code Reviews| Index: chrome/browser/chrome_browser_main.cc |
| =================================================================== |
| --- chrome/browser/chrome_browser_main.cc (revision 117096) |
| +++ chrome/browser/chrome_browser_main.cc (working copy) |
| @@ -1309,41 +1309,12 @@ |
| SecKeychainAddCallback(&KeychainCallback, 0, NULL); |
| #endif |
| + // ChromeOS needs ResourceBundle::InitSharedInstance to be called before this. |
| + browser_process_->PreCreateThreads(); |
|
Finnur
2012/01/18 17:11:06
I believe this CL caused a crasher in the toast co
|
| + |
| return content::RESULT_CODE_NORMAL_EXIT; |
| } |
| -void ChromeBrowserMainParts::PreStartThread( |
| - content::BrowserThread::ID thread_id) { |
| - browser_process_->PreStartThread(thread_id); |
| -} |
| - |
| -void ChromeBrowserMainParts::PostStartThread( |
| - content::BrowserThread::ID thread_id) { |
| - browser_process_->PostStartThread(thread_id); |
| - switch (thread_id) { |
| - case BrowserThread::FILE: |
| - // Now the command line has been mutated based on about:flags, |
| - // and the file thread has been started, we can set up metrics |
| - // and initialize field trials. |
| - metrics_ = SetupMetricsAndFieldTrials(local_state_); |
| - |
| -#if defined(USE_LINUX_BREAKPAD) |
| - // Needs to be called after we have chrome::DIR_USER_DATA and |
| - // g_browser_process. This happens in PreCreateThreads. |
| - BrowserThread::PostTask(BrowserThread::FILE, |
| - FROM_HERE, |
| - base::Bind(&GetLinuxDistroCallback)); |
| - |
| - if (IsCrashReportingEnabled(local_state_)) |
| - InitCrashReporter(); |
| -#endif |
| - break; |
| - |
| - default: |
| - break; |
| - } |
| -} |
| - |
| void ChromeBrowserMainParts::PreMainMessageLoopRun() { |
| result_code_ = PreMainMessageLoopRunImpl(); |
| @@ -1383,6 +1354,22 @@ |
| } |
| int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { |
| + // Now the command line has been mutated based on about:flags, |
| + // and the file thread has been started, we can set up metrics |
| + // and initialize field trials. |
| + metrics_ = SetupMetricsAndFieldTrials(local_state_); |
| + |
| +#if defined(USE_LINUX_BREAKPAD) |
| + // Needs to be called after we have chrome::DIR_USER_DATA and |
| + // g_browser_process. This happens in PreCreateThreads. |
| + BrowserThread::PostTask(BrowserThread::FILE, |
| + FROM_HERE, |
| + base::Bind(&GetLinuxDistroCallback)); |
| + |
| + if (IsCrashReportingEnabled(local_state_)) |
| + InitCrashReporter(); |
| +#endif |
| + |
| // Create watchdog thread after creating all other threads because it will |
| // watch the other threads and they must be running. |
| browser_process_->watchdog_thread(); |
| @@ -1391,12 +1378,6 @@ |
| // running. |
| browser_process_->PreMainMessageLoopRun(); |
| -#if defined(USE_WEBKIT_COMPOSITOR) |
| - // We need to ensure WebKit has been initialized before we start the WebKit |
| - // compositor. This is done by the ResourceDispatcherHost on creation. |
| - browser_process_->resource_dispatcher_host(); |
| -#endif |
| - |
| // Record last shutdown time into a histogram. |
| browser_shutdown::ReadLastShutdownInfo(); |
| @@ -1930,15 +1911,8 @@ |
| browser_process_->StartTearDown(); |
| } |
| -void ChromeBrowserMainParts::PreStopThread(BrowserThread::ID identifier) { |
| - browser_process_->PreStopThread(identifier); |
| -} |
| - |
| -void ChromeBrowserMainParts::PostStopThread(BrowserThread::ID identifier) { |
| - browser_process_->PostStopThread(identifier); |
| -} |
| - |
| void ChromeBrowserMainParts::PostDestroyThreads() { |
| + browser_process_->PostDestroyThreads(); |
| // browser_shutdown takes care of deleting browser_process, so we need to |
| // release it. |
| ignore_result(browser_process_.release()); |