| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // When each service is created, we set a flag indicating this. At this point, | 5 // When each service is created, we set a flag indicating this. At this point, |
| 6 // the service initialization could fail or succeed. This allows us to remember | 6 // the service initialization could fail or succeed. This allows us to remember |
| 7 // if we tried to create a service, and not try creating it over and over if | 7 // if we tried to create a service, and not try creating it over and over if |
| 8 // the creation failed. | 8 // the creation failed. |
| 9 | 9 |
| 10 #ifndef CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ | 10 #ifndef CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ |
| 11 #define CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ | 11 #define CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ |
| 12 | 12 |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
| 16 #include "base/debug/stack_trace.h" | 16 #include "base/debug/stack_trace.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
| 19 #include "base/prefs/public/pref_change_registrar.h" | 19 #include "base/prefs/public/pref_change_registrar.h" |
| 20 #include "base/prefs/public/pref_observer.h" |
| 20 #include "base/threading/non_thread_safe.h" | 21 #include "base/threading/non_thread_safe.h" |
| 21 #include "base/timer.h" | 22 #include "base/timer.h" |
| 22 #include "chrome/browser/browser_process.h" | 23 #include "chrome/browser/browser_process.h" |
| 23 #include "content/public/browser/notification_observer.h" | |
| 24 | 24 |
| 25 class ChromeNetLog; | 25 class ChromeNetLog; |
| 26 class ChromeResourceDispatcherHostDelegate; | 26 class ChromeResourceDispatcherHostDelegate; |
| 27 class CommandLine; | 27 class CommandLine; |
| 28 class RemoteDebuggingServer; | 28 class RemoteDebuggingServer; |
| 29 | 29 |
| 30 #if defined(ENABLE_PLUGIN_INSTALLATION) | 30 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 31 class PluginsResourceService; | 31 class PluginsResourceService; |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 namespace base { | 34 namespace base { |
| 35 class SequencedTaskRunner; | 35 class SequencedTaskRunner; |
| 36 } | 36 } |
| 37 | 37 |
| 38 namespace policy { | 38 namespace policy { |
| 39 class BrowserPolicyConnector; | 39 class BrowserPolicyConnector; |
| 40 class PolicyService; | 40 class PolicyService; |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 // Real implementation of BrowserProcess that creates and returns the services. | 43 // Real implementation of BrowserProcess that creates and returns the services. |
| 44 class BrowserProcessImpl : public BrowserProcess, | 44 class BrowserProcessImpl : public BrowserProcess, |
| 45 public base::NonThreadSafe, | 45 public base::NonThreadSafe, |
| 46 public content::NotificationObserver { | 46 public PrefObserver { |
| 47 public: | 47 public: |
| 48 // |local_state_task_runner| must be a shutdown-blocking task runner. | 48 // |local_state_task_runner| must be a shutdown-blocking task runner. |
| 49 BrowserProcessImpl(base::SequencedTaskRunner* local_state_task_runner, | 49 BrowserProcessImpl(base::SequencedTaskRunner* local_state_task_runner, |
| 50 const CommandLine& command_line); | 50 const CommandLine& command_line); |
| 51 virtual ~BrowserProcessImpl(); | 51 virtual ~BrowserProcessImpl(); |
| 52 | 52 |
| 53 // Called before the browser threads are created. | 53 // Called before the browser threads are created. |
| 54 void PreCreateThreads(); | 54 void PreCreateThreads(); |
| 55 | 55 |
| 56 // Called after the threads have been created but before the message loops | 56 // Called after the threads have been created but before the message loops |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 113 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| 114 virtual void StartAutoupdateTimer() OVERRIDE; | 114 virtual void StartAutoupdateTimer() OVERRIDE; |
| 115 #endif | 115 #endif |
| 116 | 116 |
| 117 virtual ChromeNetLog* net_log() OVERRIDE; | 117 virtual ChromeNetLog* net_log() OVERRIDE; |
| 118 virtual prerender::PrerenderTracker* prerender_tracker() OVERRIDE; | 118 virtual prerender::PrerenderTracker* prerender_tracker() OVERRIDE; |
| 119 virtual ComponentUpdateService* component_updater() OVERRIDE; | 119 virtual ComponentUpdateService* component_updater() OVERRIDE; |
| 120 virtual CRLSetFetcher* crl_set_fetcher() OVERRIDE; | 120 virtual CRLSetFetcher* crl_set_fetcher() OVERRIDE; |
| 121 virtual BookmarkPromptController* bookmark_prompt_controller() OVERRIDE; | 121 virtual BookmarkPromptController* bookmark_prompt_controller() OVERRIDE; |
| 122 | 122 |
| 123 // content::NotificationObserver implementation. | 123 // PrefObserver implementation. |
| 124 virtual void Observe(int type, | 124 virtual void OnPreferenceChanged(PrefServiceBase* service, |
| 125 const content::NotificationSource& source, | 125 const std::string& pref_name) OVERRIDE; |
| 126 const content::NotificationDetails& details) OVERRIDE; | |
| 127 | 126 |
| 128 private: | 127 private: |
| 129 void CreateMetricsService(); | 128 void CreateMetricsService(); |
| 130 void CreateWatchdogThread(); | 129 void CreateWatchdogThread(); |
| 131 #if defined(OS_CHROMEOS) | 130 #if defined(OS_CHROMEOS) |
| 132 void InitializeWebSocketProxyThread(); | 131 void InitializeWebSocketProxyThread(); |
| 133 #endif | 132 #endif |
| 134 void CreateProfileManager(); | 133 void CreateProfileManager(); |
| 135 void CreateLocalState(); | 134 void CreateLocalState(); |
| 136 void CreateViewedPageTracker(); | 135 void CreateViewedPageTracker(); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 scoped_refptr<PluginsResourceService> plugins_resource_service_; | 271 scoped_refptr<PluginsResourceService> plugins_resource_service_; |
| 273 #endif | 272 #endif |
| 274 // TODO(eroman): Remove this when done debugging 113031. This tracks | 273 // TODO(eroman): Remove this when done debugging 113031. This tracks |
| 275 // the callstack which released the final module reference count. | 274 // the callstack which released the final module reference count. |
| 276 base::debug::StackTrace release_last_reference_callstack_; | 275 base::debug::StackTrace release_last_reference_callstack_; |
| 277 | 276 |
| 278 DISALLOW_COPY_AND_ASSIGN(BrowserProcessImpl); | 277 DISALLOW_COPY_AND_ASSIGN(BrowserProcessImpl); |
| 279 }; | 278 }; |
| 280 | 279 |
| 281 #endif // CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ | 280 #endif // CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ |
| OLD | NEW |