| 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 base { | 35 namespace base { |
| 36 class SequencedTaskRunner; | 36 class SequencedTaskRunner; |
| 37 } | 37 } |
| 38 | 38 |
| 39 namespace policy { | 39 namespace policy { |
| 40 class BrowserPolicyConnector; | 40 class BrowserPolicyConnector; |
| 41 class PolicyService; | 41 class PolicyService; |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 // Real implementation of BrowserProcess that creates and returns the services. | 44 // Real implementation of BrowserProcess that creates and returns the services. |
| 45 class BrowserProcessImpl : public BrowserProcess, | 45 class BrowserProcessImpl : public BrowserProcess, |
| 46 public base::NonThreadSafe, | 46 public base::NonThreadSafe, |
| 47 public content::NotificationObserver { | 47 public PrefObserver { |
| 48 public: | 48 public: |
| 49 // |local_state_task_runner| must be a shutdown-blocking task runner. | 49 // |local_state_task_runner| must be a shutdown-blocking task runner. |
| 50 BrowserProcessImpl(base::SequencedTaskRunner* local_state_task_runner, | 50 BrowserProcessImpl(base::SequencedTaskRunner* local_state_task_runner, |
| 51 const CommandLine& command_line); | 51 const CommandLine& command_line); |
| 52 virtual ~BrowserProcessImpl(); | 52 virtual ~BrowserProcessImpl(); |
| 53 | 53 |
| 54 // Called before the browser threads are created. | 54 // Called before the browser threads are created. |
| 55 void PreCreateThreads(); | 55 void PreCreateThreads(); |
| 56 | 56 |
| 57 // Called after the threads have been created but before the message loops | 57 // Called after the threads have been created but before the message loops |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 115 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| 116 virtual void StartAutoupdateTimer() OVERRIDE; | 116 virtual void StartAutoupdateTimer() OVERRIDE; |
| 117 #endif | 117 #endif |
| 118 | 118 |
| 119 virtual ChromeNetLog* net_log() OVERRIDE; | 119 virtual ChromeNetLog* net_log() OVERRIDE; |
| 120 virtual prerender::PrerenderTracker* prerender_tracker() OVERRIDE; | 120 virtual prerender::PrerenderTracker* prerender_tracker() OVERRIDE; |
| 121 virtual ComponentUpdateService* component_updater() OVERRIDE; | 121 virtual ComponentUpdateService* component_updater() OVERRIDE; |
| 122 virtual CRLSetFetcher* crl_set_fetcher() OVERRIDE; | 122 virtual CRLSetFetcher* crl_set_fetcher() OVERRIDE; |
| 123 virtual BookmarkPromptController* bookmark_prompt_controller() OVERRIDE; | 123 virtual BookmarkPromptController* bookmark_prompt_controller() OVERRIDE; |
| 124 | 124 |
| 125 // content::NotificationObserver implementation. | 125 // PrefObserver implementation. |
| 126 virtual void Observe(int type, | 126 virtual void OnPreferenceChanged(PrefServiceBase* service, |
| 127 const content::NotificationSource& source, | 127 const std::string& pref_name) OVERRIDE; |
| 128 const content::NotificationDetails& details) OVERRIDE; | |
| 129 | 128 |
| 130 private: | 129 private: |
| 131 void CreateMetricsService(); | 130 void CreateMetricsService(); |
| 132 void CreateWatchdogThread(); | 131 void CreateWatchdogThread(); |
| 133 #if defined(OS_CHROMEOS) | 132 #if defined(OS_CHROMEOS) |
| 134 void InitializeWebSocketProxyThread(); | 133 void InitializeWebSocketProxyThread(); |
| 135 #endif | 134 #endif |
| 136 void CreateProfileManager(); | 135 void CreateProfileManager(); |
| 137 void CreateLocalState(); | 136 void CreateLocalState(); |
| 138 void CreateViewedPageTracker(); | 137 void CreateViewedPageTracker(); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 scoped_refptr<PluginsResourceService> plugins_resource_service_; | 276 scoped_refptr<PluginsResourceService> plugins_resource_service_; |
| 278 #endif | 277 #endif |
| 279 // TODO(eroman): Remove this when done debugging 113031. This tracks | 278 // TODO(eroman): Remove this when done debugging 113031. This tracks |
| 280 // the callstack which released the final module reference count. | 279 // the callstack which released the final module reference count. |
| 281 base::debug::StackTrace release_last_reference_callstack_; | 280 base::debug::StackTrace release_last_reference_callstack_; |
| 282 | 281 |
| 283 DISALLOW_COPY_AND_ASSIGN(BrowserProcessImpl); | 282 DISALLOW_COPY_AND_ASSIGN(BrowserProcessImpl); |
| 284 }; | 283 }; |
| 285 | 284 |
| 286 #endif // CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ | 285 #endif // CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ |
| OLD | NEW |