Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Side by Side Diff: chrome/browser/browser_process_impl.h

Issue 6292017: Extended: Add "system" URLRequestContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Continued Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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;
willchan no longer on Chromium 2011/02/08 22:52:04 No indent
battre 2011/02/14 18:22:05 Done.
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 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 22 matching lines...) Expand all
96 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 104 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
97 virtual void StartAutoupdateTimer(); 105 virtual void StartAutoupdateTimer();
98 #endif 106 #endif
99 107
100 virtual bool have_inspector_files() const; 108 virtual bool have_inspector_files() const;
101 109
102 #if defined(IPC_MESSAGE_LOG_ENABLED) 110 #if defined(IPC_MESSAGE_LOG_ENABLED)
103 virtual void SetIPCLoggingEnabled(bool enable); 111 virtual void SetIPCLoggingEnabled(bool enable);
104 #endif 112 #endif
105 113
114 virtual void InitSystemRequestContext();
115
106 private: 116 private:
107 void ClearLocalState(const FilePath& profile_path); 117 void ClearLocalState(const FilePath& profile_path);
108 bool ShouldClearLocalState(FilePath* profile_path); 118 bool ShouldClearLocalState(FilePath* profile_path);
109 119
110 void CreateResourceDispatcherHost(); 120 void CreateResourceDispatcherHost();
111 void CreatePrefService(); 121 void CreatePrefService();
112 void CreateMetricsService(); 122 void CreateMetricsService();
113 123
114 void CreateIOThread(); 124 void CreateIOThread();
115 static void CleanupOnIOThread(); 125 static void CleanupOnIOThread();
(...skipping 12 matching lines...) Expand all
128 void CreateIconManager(); 138 void CreateIconManager();
129 void CreateDevToolsManager(); 139 void CreateDevToolsManager();
130 void CreateSidebarManager(); 140 void CreateSidebarManager();
131 void CreateGoogleURLTracker(); 141 void CreateGoogleURLTracker();
132 void CreateIntranetRedirectDetector(); 142 void CreateIntranetRedirectDetector();
133 void CreateNotificationUIManager(); 143 void CreateNotificationUIManager();
134 void CreateStatusTrayManager(); 144 void CreateStatusTrayManager();
135 void CreateTabCloseableStateWatcher(); 145 void CreateTabCloseableStateWatcher();
136 void CreatePrintPreviewTabController(); 146 void CreatePrintPreviewTabController();
137 void CreateSafeBrowsingDetectionService(); 147 void CreateSafeBrowsingDetectionService();
148 void CreatePrefProxyConfigTracker();
149 void CreateSystemRequestContextGetter();
138 150
139 bool IsSafeBrowsingDetectionServiceEnabled(); 151 bool IsSafeBrowsingDetectionServiceEnabled();
140 152
141 #if defined(IPC_MESSAGE_LOG_ENABLED) 153 #if defined(IPC_MESSAGE_LOG_ENABLED)
142 void SetIPCLoggingEnabledForChildProcesses(bool enabled); 154 void SetIPCLoggingEnabledForChildProcesses(bool enabled);
143 #endif 155 #endif
144 156
145 bool created_resource_dispatcher_host_; 157 bool created_resource_dispatcher_host_;
146 scoped_ptr<ResourceDispatcherHost> resource_dispatcher_host_; 158 scoped_ptr<ResourceDispatcherHost> resource_dispatcher_host_;
147 159
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 scoped_ptr<IntranetRedirectDetector> intranet_redirect_detector_; 217 scoped_ptr<IntranetRedirectDetector> intranet_redirect_detector_;
206 218
207 scoped_ptr<NotificationService> main_notification_service_; 219 scoped_ptr<NotificationService> main_notification_service_;
208 220
209 scoped_ptr<TabCloseableStateWatcher> tab_closeable_state_watcher_; 221 scoped_ptr<TabCloseableStateWatcher> tab_closeable_state_watcher_;
210 222
211 bool created_safe_browsing_detection_service_; 223 bool created_safe_browsing_detection_service_;
212 scoped_ptr<safe_browsing::ClientSideDetectionService> 224 scoped_ptr<safe_browsing::ClientSideDetectionService>
213 safe_browsing_detection_service_; 225 safe_browsing_detection_service_;
214 226
227 bool created_pref_proxy_config_tracker_;
228 scoped_refptr<PrefProxyConfigTracker> pref_proxy_config_tracker_;
229
230 bool created_system_request_context_;
231 scoped_refptr<URLRequestContextGetter> system_request_context_;
232
215 unsigned int module_ref_count_; 233 unsigned int module_ref_count_;
216 bool did_start_; 234 bool did_start_;
217 235
218 // Ensures that all the print jobs are finished before closing the browser. 236 // Ensures that all the print jobs are finished before closing the browser.
219 scoped_ptr<printing::PrintJobManager> print_job_manager_; 237 scoped_ptr<printing::PrintJobManager> print_job_manager_;
220 238
221 std::string locale_; 239 std::string locale_;
222 240
223 bool checked_for_new_frames_; 241 bool checked_for_new_frames_;
224 bool using_new_frames_; 242 bool using_new_frames_;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 // restarted, and if that's the case, restarts the browser. 276 // restarted, and if that's the case, restarts the browser.
259 void OnAutoupdateTimer(); 277 void OnAutoupdateTimer();
260 bool CanAutorestartForUpdate() const; 278 bool CanAutorestartForUpdate() const;
261 void RestartPersistentInstance(); 279 void RestartPersistentInstance();
262 #endif // defined(OS_WIN) || defined(OS_LINUX) 280 #endif // defined(OS_WIN) || defined(OS_LINUX)
263 281
264 DISALLOW_COPY_AND_ASSIGN(BrowserProcessImpl); 282 DISALLOW_COPY_AND_ASSIGN(BrowserProcessImpl);
265 }; 283 };
266 284
267 #endif // CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ 285 #endif // CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698