diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-10 19:31:57 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-10 19:31:57 +0000 |
commit | b4e74ee7fa50d5880f6cfdb6e2d10c8e8bb98cc1 (patch) | |
tree | 40c6afa656bd48496d696790e9d47a4a7df4b315 /chrome/browser/browser_process_impl.h | |
parent | 0a424afc9c94380ecd80967be73cfb684b6ae3f4 (diff) | |
download | chromium_src-b4e74ee7fa50d5880f6cfdb6e2d10c8e8bb98cc1.zip chromium_src-b4e74ee7fa50d5880f6cfdb6e2d10c8e8bb98cc1.tar.gz chromium_src-b4e74ee7fa50d5880f6cfdb6e2d10c8e8bb98cc1.tar.bz2 |
Move creation and ownership of ResourceDispatcherHost and PluginService to content. This gives a few benefits:
-avoid having each embedder know when to create/destruct these objects, as well as contained objects (i.e. those related to downloads)
-avoid having to tell embedders about specifics of BrowserThread startup/shutdown
-move ResourceDispatcherHost's getter to content where it belongs
Some code (extensions+promos) used the fact that RDH is NULL in unittests as a signal to not use the utility process. I've switches those unittests to set a flag on the objects instead.
I've taken out the DnsParallelism field trial (not used anymore, confirmed with jar) as it was the only thing that caused MetricsService to depend on IOThread initialization, which also depended on MetricsService (through FieldTrials). This two-sided dependency always annoyed me and made the code hard to restructure.
BUG=98716
Review URL: http://codereview.chromium.org/9150016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117078 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_process_impl.h')
-rw-r--r-- | chrome/browser/browser_process_impl.h | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h index 54e926f..8c03cbb 100644 --- a/chrome/browser/browser_process_impl.h +++ b/chrome/browser/browser_process_impl.h @@ -45,10 +45,8 @@ class BrowserProcessImpl : public BrowserProcess, explicit BrowserProcessImpl(const CommandLine& command_line); virtual ~BrowserProcessImpl(); - // Some of our startup is interleaved with thread creation, driven - // by these functions. - void PreStartThread(content::BrowserThread::ID identifier); - void PostStartThread(content::BrowserThread::ID identifier); + // Called before the browser threads are created. + void PreCreateThreads(); // Called after the threads have been created but before the message loops // starts running. Allows the browser process to do any initialization that @@ -60,12 +58,11 @@ class BrowserProcessImpl : public BrowserProcess, // framework, rather than in the destructor, so that we can // interleave cleanup with threads being stopped. void StartTearDown(); - void PreStopThread(content::BrowserThread::ID identifier); - void PostStopThread(content::BrowserThread::ID identifier); + void PostDestroyThreads(); // BrowserProcess methods + virtual void ResourceDispatcherHostCreated() OVERRIDE; virtual void EndSession() OVERRIDE; - virtual ResourceDispatcherHost* resource_dispatcher_host() OVERRIDE; virtual MetricsService* metrics_service() OVERRIDE; virtual IOThread* io_thread() OVERRIDE; virtual WatchDogThread* watchdog_thread() OVERRIDE; @@ -127,12 +124,7 @@ class BrowserProcessImpl : public BrowserProcess, virtual AudioManager* audio_manager() OVERRIDE; private: - // Must be called right before the IO thread is started. - void CreateIOThreadState(); - - void CreateResourceDispatcherHost(); void CreateMetricsService(); - void CreateWatchdogThread(); #if defined(OS_CHROMEOS) void InitializeWebSocketProxyThread(); @@ -159,9 +151,6 @@ class BrowserProcessImpl : public BrowserProcess, void ApplyAllowCrossOriginAuthPromptPolicy(); void ApplyDefaultBrowserPolicy(); - bool created_resource_dispatcher_host_; - scoped_ptr<ResourceDispatcherHost> resource_dispatcher_host_; - bool created_metrics_service_; scoped_ptr<MetricsService> metrics_service_; |