OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 12 #pragma once |
13 | 13 |
14 #include <string> | 14 #include <string> |
15 | 15 |
16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
17 #include "base/message_loop.h" | 17 #include "base/message_loop.h" |
18 #include "base/threading/non_thread_safe.h" | 18 #include "base/threading/non_thread_safe.h" |
19 #include "base/timer.h" | 19 #include "base/timer.h" |
20 #include "base/scoped_ptr.h" | 20 #include "base/scoped_ptr.h" |
21 #include "chrome/browser/browser_process.h" | 21 #include "chrome/browser/browser_process.h" |
22 #include "chrome/browser/download/download_status_updater.h" | 22 #include "chrome/browser/download/download_status_updater.h" |
23 #include "chrome/browser/net/pref_proxy_config_service.h" | |
23 #include "chrome/browser/prefs/pref_change_registrar.h" | 24 #include "chrome/browser/prefs/pref_change_registrar.h" |
24 #include "chrome/browser/tab_contents/thumbnail_generator.h" | 25 #include "chrome/browser/tab_contents/thumbnail_generator.h" |
25 #include "chrome/common/notification_observer.h" | 26 #include "chrome/common/notification_observer.h" |
26 #include "chrome/common/notification_registrar.h" | 27 #include "chrome/common/notification_registrar.h" |
27 #include "ipc/ipc_message.h" | 28 #include "ipc/ipc_message.h" |
28 | 29 |
29 class ChromeNetLog; | 30 class ChromeNetLog; |
30 class CommandLine; | 31 class CommandLine; |
31 class DevToolsHttpProtocolHandler; | 32 class DevToolsHttpProtocolHandler; |
32 class DevToolsProtocolHandler; | 33 class DevToolsProtocolHandler; |
33 class FilePath; | 34 class FilePath; |
34 class NotificationService; | 35 class NotificationService; |
35 class PluginDataRemover; | 36 class PluginDataRemover; |
37 class PrefProxyConfigTracker; | |
36 class TabCloseableStateWatcher; | 38 class TabCloseableStateWatcher; |
37 | 39 |
40 namespace net { | |
41 class ProxyConfigService; | |
42 } // namespace net | |
43 | |
38 // Real implementation of BrowserProcess that creates and returns the services. | 44 // Real implementation of BrowserProcess that creates and returns the services. |
39 class BrowserProcessImpl : public BrowserProcess, | 45 class BrowserProcessImpl : public BrowserProcess, |
40 public base::NonThreadSafe, | 46 public base::NonThreadSafe, |
41 public NotificationObserver { | 47 public NotificationObserver { |
42 public: | 48 public: |
43 explicit BrowserProcessImpl(const CommandLine& command_line); | 49 explicit BrowserProcessImpl(const CommandLine& command_line); |
44 virtual ~BrowserProcessImpl(); | 50 virtual ~BrowserProcessImpl(); |
45 | 51 |
46 virtual void EndSession(); | 52 virtual void EndSession(); |
47 | 53 |
48 // BrowserProcess methods | 54 // BrowserProcess methods |
49 virtual ResourceDispatcherHost* resource_dispatcher_host(); | 55 virtual ResourceDispatcherHost* resource_dispatcher_host(); |
50 virtual MetricsService* metrics_service(); | 56 virtual MetricsService* metrics_service(); |
51 virtual IOThread* io_thread(); | 57 virtual IOThread* io_thread(); |
52 virtual base::Thread* file_thread(); | 58 virtual base::Thread* file_thread(); |
53 virtual base::Thread* db_thread(); | 59 virtual base::Thread* db_thread(); |
54 virtual base::Thread* process_launcher_thread(); | 60 virtual base::Thread* process_launcher_thread(); |
55 virtual base::Thread* cache_thread(); | 61 virtual base::Thread* cache_thread(); |
56 #if defined(USE_X11) | 62 #if defined(USE_X11) |
57 virtual base::Thread* background_x11_thread(); | 63 virtual base::Thread* background_x11_thread(); |
58 #endif | 64 #endif |
59 virtual ProfileManager* profile_manager(); | 65 virtual ProfileManager* profile_manager(); |
60 virtual PrefService* local_state(); | 66 virtual PrefService* local_state(); |
61 virtual DevToolsManager* devtools_manager(); | 67 virtual DevToolsManager* devtools_manager(); |
62 virtual SidebarManager* sidebar_manager(); | 68 virtual SidebarManager* sidebar_manager(); |
63 virtual ui::Clipboard* clipboard(); | 69 virtual ui::Clipboard* clipboard(); |
70 virtual PrefProxyConfigTracker* pref_proxy_config_tracker(); | |
71 virtual scoped_refptr<URLRequestContextGetter> system_request_context(); | |
64 virtual NotificationUIManager* notification_ui_manager(); | 72 virtual NotificationUIManager* notification_ui_manager(); |
65 virtual policy::ConfigurationPolicyProviderKeeper* | 73 virtual policy::ConfigurationPolicyProviderKeeper* |
66 configuration_policy_provider_keeper(); | 74 configuration_policy_provider_keeper(); |
67 virtual IconManager* icon_manager(); | 75 virtual IconManager* icon_manager(); |
68 virtual ThumbnailGenerator* GetThumbnailGenerator(); | 76 virtual ThumbnailGenerator* GetThumbnailGenerator(); |
69 virtual AutomationProviderList* InitAutomationProviderList(); | 77 virtual AutomationProviderList* InitAutomationProviderList(); |
70 virtual void InitDevToolsHttpProtocolHandler( | 78 virtual void InitDevToolsHttpProtocolHandler( |
71 const std::string& ip, | 79 const std::string& ip, |
72 int port, | 80 int port, |
73 const std::string& frontend_url); | 81 const std::string& frontend_url); |
(...skipping 24 matching lines...) Expand all Loading... | |
98 #endif | 106 #endif |
99 | 107 |
100 virtual bool have_inspector_files() const; | 108 virtual bool have_inspector_files() const; |
101 | 109 |
102 virtual ChromeNetLog* net_log(); | 110 virtual ChromeNetLog* net_log(); |
103 | 111 |
104 #if defined(IPC_MESSAGE_LOG_ENABLED) | 112 #if defined(IPC_MESSAGE_LOG_ENABLED) |
105 virtual void SetIPCLoggingEnabled(bool enable); | 113 virtual void SetIPCLoggingEnabled(bool enable); |
106 #endif | 114 #endif |
107 | 115 |
116 virtual void InitSystemRequestContext(); | |
willchan no longer on Chromium
2011/02/15 01:05:58
Isn't this a BrowserProcess method? Should it be w
battre
2011/02/15 19:32:49
This is gone.
| |
117 | |
108 private: | 118 private: |
109 void ClearLocalState(const FilePath& profile_path); | 119 void ClearLocalState(const FilePath& profile_path); |
110 bool ShouldClearLocalState(FilePath* profile_path); | 120 bool ShouldClearLocalState(FilePath* profile_path); |
111 | 121 |
112 void CreateResourceDispatcherHost(); | 122 void CreateResourceDispatcherHost(); |
113 void CreatePrefService(); | 123 void CreatePrefService(); |
114 void CreateMetricsService(); | 124 void CreateMetricsService(); |
115 | 125 |
116 void CreateIOThread(); | 126 void CreateIOThread(); |
117 static void CleanupOnIOThread(); | 127 static void CleanupOnIOThread(); |
(...skipping 12 matching lines...) Expand all Loading... | |
130 void CreateIconManager(); | 140 void CreateIconManager(); |
131 void CreateDevToolsManager(); | 141 void CreateDevToolsManager(); |
132 void CreateSidebarManager(); | 142 void CreateSidebarManager(); |
133 void CreateGoogleURLTracker(); | 143 void CreateGoogleURLTracker(); |
134 void CreateIntranetRedirectDetector(); | 144 void CreateIntranetRedirectDetector(); |
135 void CreateNotificationUIManager(); | 145 void CreateNotificationUIManager(); |
136 void CreateStatusTrayManager(); | 146 void CreateStatusTrayManager(); |
137 void CreateTabCloseableStateWatcher(); | 147 void CreateTabCloseableStateWatcher(); |
138 void CreatePrintPreviewTabController(); | 148 void CreatePrintPreviewTabController(); |
139 void CreateSafeBrowsingDetectionService(); | 149 void CreateSafeBrowsingDetectionService(); |
150 void CreatePrefProxyConfigTracker(); | |
151 void CreateSystemRequestContextGetter(); | |
140 | 152 |
141 bool IsSafeBrowsingDetectionServiceEnabled(); | 153 bool IsSafeBrowsingDetectionServiceEnabled(); |
142 | 154 |
143 #if defined(IPC_MESSAGE_LOG_ENABLED) | 155 #if defined(IPC_MESSAGE_LOG_ENABLED) |
144 void SetIPCLoggingEnabledForChildProcesses(bool enabled); | 156 void SetIPCLoggingEnabledForChildProcesses(bool enabled); |
145 #endif | 157 #endif |
146 | 158 |
147 bool created_resource_dispatcher_host_; | 159 bool created_resource_dispatcher_host_; |
148 scoped_ptr<ResourceDispatcherHost> resource_dispatcher_host_; | 160 scoped_ptr<ResourceDispatcherHost> resource_dispatcher_host_; |
149 | 161 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
207 scoped_ptr<IntranetRedirectDetector> intranet_redirect_detector_; | 219 scoped_ptr<IntranetRedirectDetector> intranet_redirect_detector_; |
208 | 220 |
209 scoped_ptr<NotificationService> main_notification_service_; | 221 scoped_ptr<NotificationService> main_notification_service_; |
210 | 222 |
211 scoped_ptr<TabCloseableStateWatcher> tab_closeable_state_watcher_; | 223 scoped_ptr<TabCloseableStateWatcher> tab_closeable_state_watcher_; |
212 | 224 |
213 bool created_safe_browsing_detection_service_; | 225 bool created_safe_browsing_detection_service_; |
214 scoped_ptr<safe_browsing::ClientSideDetectionService> | 226 scoped_ptr<safe_browsing::ClientSideDetectionService> |
215 safe_browsing_detection_service_; | 227 safe_browsing_detection_service_; |
216 | 228 |
229 bool created_pref_proxy_config_tracker_; | |
230 scoped_refptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; | |
231 | |
232 bool created_system_request_context_; | |
233 scoped_refptr<URLRequestContextGetter> system_request_context_; | |
234 | |
217 unsigned int module_ref_count_; | 235 unsigned int module_ref_count_; |
218 bool did_start_; | 236 bool did_start_; |
219 | 237 |
220 // Ensures that all the print jobs are finished before closing the browser. | 238 // Ensures that all the print jobs are finished before closing the browser. |
221 scoped_ptr<printing::PrintJobManager> print_job_manager_; | 239 scoped_ptr<printing::PrintJobManager> print_job_manager_; |
222 | 240 |
223 std::string locale_; | 241 std::string locale_; |
224 | 242 |
225 bool checked_for_new_frames_; | 243 bool checked_for_new_frames_; |
226 bool using_new_frames_; | 244 bool using_new_frames_; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
260 // restarted, and if that's the case, restarts the browser. | 278 // restarted, and if that's the case, restarts the browser. |
261 void OnAutoupdateTimer(); | 279 void OnAutoupdateTimer(); |
262 bool CanAutorestartForUpdate() const; | 280 bool CanAutorestartForUpdate() const; |
263 void RestartPersistentInstance(); | 281 void RestartPersistentInstance(); |
264 #endif // defined(OS_WIN) || defined(OS_LINUX) | 282 #endif // defined(OS_WIN) || defined(OS_LINUX) |
265 | 283 |
266 DISALLOW_COPY_AND_ASSIGN(BrowserProcessImpl); | 284 DISALLOW_COPY_AND_ASSIGN(BrowserProcessImpl); |
267 }; | 285 }; |
268 | 286 |
269 #endif // CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ | 287 #endif // CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ |
OLD | NEW |