Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1316)

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 9150016: Move creation and ownership of ResourceDispatcherHost and PluginService to content. This gives a ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix chromeos ui_tests Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_browser_main.h ('k') | chrome/browser/chrome_content_browser_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « chrome/browser/chrome_browser_main.h ('k') | chrome/browser/chrome_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698