| 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/api/prefs/pref_member.h" | 23 #include "chrome/browser/api/prefs/pref_member.h" |
| 23 #include "chrome/browser/browser_process.h" | 24 #include "chrome/browser/browser_process.h" |
| 24 #include "content/public/browser/notification_observer.h" | |
| 25 | 25 |
| 26 class ChromeNetLog; | 26 class ChromeNetLog; |
| 27 class ChromeResourceDispatcherHostDelegate; | 27 class ChromeResourceDispatcherHostDelegate; |
| 28 class CommandLine; | 28 class CommandLine; |
| 29 class RemoteDebuggingServer; | 29 class RemoteDebuggingServer; |
| 30 | 30 |
| 31 #if defined(ENABLE_PLUGIN_INSTALLATION) | 31 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 32 class PluginsResourceService; | 32 class PluginsResourceService; |
| 33 #endif | 33 #endif |
| 34 | 34 |
| 35 namespace policy { | 35 namespace policy { |
| 36 class BrowserPolicyConnector; | 36 class BrowserPolicyConnector; |
| 37 class PolicyService; | 37 class PolicyService; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 // Real implementation of BrowserProcess that creates and returns the services. | 40 // Real implementation of BrowserProcess that creates and returns the services. |
| 41 class BrowserProcessImpl : public BrowserProcess, | 41 class BrowserProcessImpl : public BrowserProcess, |
| 42 public base::NonThreadSafe, | 42 public base::NonThreadSafe, |
| 43 public content::NotificationObserver { | 43 public PrefObserver { |
| 44 public: | 44 public: |
| 45 explicit BrowserProcessImpl(const CommandLine& command_line); | 45 explicit BrowserProcessImpl(const CommandLine& command_line); |
| 46 virtual ~BrowserProcessImpl(); | 46 virtual ~BrowserProcessImpl(); |
| 47 | 47 |
| 48 // Called before the browser threads are created. | 48 // Called before the browser threads are created. |
| 49 void PreCreateThreads(); | 49 void PreCreateThreads(); |
| 50 | 50 |
| 51 // Called after the threads have been created but before the message loops | 51 // Called after the threads have been created but before the message loops |
| 52 // starts running. Allows the browser process to do any initialization that | 52 // starts running. Allows the browser process to do any initialization that |
| 53 // requires all threads running. | 53 // requires all threads running. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 108 |
| 109 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 109 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| 110 virtual void StartAutoupdateTimer() OVERRIDE; | 110 virtual void StartAutoupdateTimer() OVERRIDE; |
| 111 #endif | 111 #endif |
| 112 | 112 |
| 113 virtual ChromeNetLog* net_log() OVERRIDE; | 113 virtual ChromeNetLog* net_log() OVERRIDE; |
| 114 virtual prerender::PrerenderTracker* prerender_tracker() OVERRIDE; | 114 virtual prerender::PrerenderTracker* prerender_tracker() OVERRIDE; |
| 115 virtual ComponentUpdateService* component_updater() OVERRIDE; | 115 virtual ComponentUpdateService* component_updater() OVERRIDE; |
| 116 virtual CRLSetFetcher* crl_set_fetcher() OVERRIDE; | 116 virtual CRLSetFetcher* crl_set_fetcher() OVERRIDE; |
| 117 | 117 |
| 118 // content::NotificationObserver implementation. | 118 // PrefObserver implementation. |
| 119 virtual void Observe(int type, | 119 virtual void OnPreferenceChanged(PrefServiceBase* service, |
| 120 const content::NotificationSource& source, | 120 const std::string& pref_name) OVERRIDE; |
| 121 const content::NotificationDetails& details) OVERRIDE; | |
| 122 | 121 |
| 123 private: | 122 private: |
| 124 void CreateMetricsService(); | 123 void CreateMetricsService(); |
| 125 void CreateWatchdogThread(); | 124 void CreateWatchdogThread(); |
| 126 #if defined(OS_CHROMEOS) | 125 #if defined(OS_CHROMEOS) |
| 127 void InitializeWebSocketProxyThread(); | 126 void InitializeWebSocketProxyThread(); |
| 128 #endif | 127 #endif |
| 129 void CreateProfileManager(); | 128 void CreateProfileManager(); |
| 130 void CreateLocalState(); | 129 void CreateLocalState(); |
| 131 void CreateViewedPageTracker(); | 130 void CreateViewedPageTracker(); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 scoped_refptr<PluginsResourceService> plugins_resource_service_; | 263 scoped_refptr<PluginsResourceService> plugins_resource_service_; |
| 265 #endif | 264 #endif |
| 266 // TODO(eroman): Remove this when done debugging 113031. This tracks | 265 // TODO(eroman): Remove this when done debugging 113031. This tracks |
| 267 // the callstack which released the final module reference count. | 266 // the callstack which released the final module reference count. |
| 268 base::debug::StackTrace release_last_reference_callstack_; | 267 base::debug::StackTrace release_last_reference_callstack_; |
| 269 | 268 |
| 270 DISALLOW_COPY_AND_ASSIGN(BrowserProcessImpl); | 269 DISALLOW_COPY_AND_ASSIGN(BrowserProcessImpl); |
| 271 }; | 270 }; |
| 272 | 271 |
| 273 #endif // CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ | 272 #endif // CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ |
| OLD | NEW |