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 #ifndef CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
6 #define CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
18 #include "chrome/browser/net/chrome_url_request_context.h" | 18 #include "chrome/browser/net/chrome_url_request_context.h" |
19 #include "chrome/browser/prefs/pref_member.h" | 19 #include "chrome/browser/prefs/pref_member.h" |
20 #include "content/public/browser/resource_context.h" | 20 #include "content/public/browser/resource_context.h" |
21 #include "net/base/cookie_monster.h" | 21 #include "net/base/cookie_monster.h" |
22 | 22 |
23 class AudioManager; | |
24 class CookieSettings; | 23 class CookieSettings; |
25 class DesktopNotificationService; | 24 class DesktopNotificationService; |
26 class ExtensionInfoMap; | 25 class ExtensionInfoMap; |
27 class HostContentSettingsMap; | 26 class HostContentSettingsMap; |
28 class IOThread; | 27 class IOThread; |
29 class Profile; | 28 class Profile; |
30 class ProtocolHandlerRegistry; | 29 class ProtocolHandlerRegistry; |
31 class TransportSecurityPersister; | 30 class TransportSecurityPersister; |
32 class WebKitContext; | 31 class WebKitContext; |
33 | 32 |
34 namespace media_stream { | |
35 class MediaStreamManager; | |
36 } // namespace media_stream | |
37 | |
38 namespace net { | 33 namespace net { |
39 class CookieStore; | 34 class CookieStore; |
40 class FraudulentCertificateReporter; | 35 class FraudulentCertificateReporter; |
41 class HttpTransactionFactory; | 36 class HttpTransactionFactory; |
42 class OriginBoundCertService; | 37 class OriginBoundCertService; |
43 class ProxyConfigService; | 38 class ProxyConfigService; |
44 class ProxyService; | 39 class ProxyService; |
45 class SSLConfigService; | 40 class SSLConfigService; |
46 class TransportSecurityState; | 41 class TransportSecurityState; |
47 } // namespace net | 42 } // namespace net |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 ProfileParams(); | 126 ProfileParams(); |
132 ~ProfileParams(); | 127 ~ProfileParams(); |
133 | 128 |
134 FilePath path; | 129 FilePath path; |
135 bool is_incognito; | 130 bool is_incognito; |
136 bool clear_local_state_on_exit; | 131 bool clear_local_state_on_exit; |
137 std::string accept_language; | 132 std::string accept_language; |
138 std::string accept_charset; | 133 std::string accept_charset; |
139 std::string referrer_charset; | 134 std::string referrer_charset; |
140 IOThread* io_thread; | 135 IOThread* io_thread; |
141 AudioManager* audio_manager; | |
142 scoped_refptr<HostContentSettingsMap> host_content_settings_map; | 136 scoped_refptr<HostContentSettingsMap> host_content_settings_map; |
143 scoped_refptr<CookieSettings> cookie_settings; | 137 scoped_refptr<CookieSettings> cookie_settings; |
144 scoped_refptr<net::SSLConfigService> ssl_config_service; | 138 scoped_refptr<net::SSLConfigService> ssl_config_service; |
145 scoped_refptr<net::CookieMonster::Delegate> cookie_monster_delegate; | 139 scoped_refptr<net::CookieMonster::Delegate> cookie_monster_delegate; |
146 scoped_refptr<WebKitContext> webkit_context; | 140 scoped_refptr<WebKitContext> webkit_context; |
147 scoped_refptr<ExtensionInfoMap> extension_info_map; | 141 scoped_refptr<ExtensionInfoMap> extension_info_map; |
148 DesktopNotificationService* notification_service; | 142 DesktopNotificationService* notification_service; |
149 scoped_refptr<ProtocolHandlerRegistry> protocol_handler_registry; | 143 scoped_refptr<ProtocolHandlerRegistry> protocol_handler_registry; |
150 // We need to initialize the ProxyConfigService from the UI thread | 144 // We need to initialize the ProxyConfigService from the UI thread |
151 // because on linux it relies on initializing things through gconf, | 145 // because on linux it relies on initializing things through gconf, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 explicit ResourceContext(ProfileIOData* io_data); | 206 explicit ResourceContext(ProfileIOData* io_data); |
213 virtual ~ResourceContext(); | 207 virtual ~ResourceContext(); |
214 | 208 |
215 private: | 209 private: |
216 friend class ProfileIOData; | 210 friend class ProfileIOData; |
217 | 211 |
218 // ResourceContext implementation: | 212 // ResourceContext implementation: |
219 virtual net::HostResolver* GetHostResolver() OVERRIDE; | 213 virtual net::HostResolver* GetHostResolver() OVERRIDE; |
220 virtual net::URLRequestContext* GetRequestContext() OVERRIDE; | 214 virtual net::URLRequestContext* GetRequestContext() OVERRIDE; |
221 virtual MediaObserver* GetMediaObserver() OVERRIDE; | 215 virtual MediaObserver* GetMediaObserver() OVERRIDE; |
222 virtual media_stream::MediaStreamManager* GetMediaStreamManager() OVERRIDE; | |
223 virtual AudioManager* GetAudioManager() OVERRIDE; | |
224 | 216 |
225 void EnsureInitialized(); | 217 void EnsureInitialized(); |
226 | 218 |
227 ProfileIOData* const io_data_; | 219 ProfileIOData* const io_data_; |
228 | 220 |
229 net::HostResolver* host_resolver_; | 221 net::HostResolver* host_resolver_; |
230 net::URLRequestContext* request_context_; | 222 net::URLRequestContext* request_context_; |
231 MediaObserver* media_observer_; | 223 MediaObserver* media_observer_; |
232 media_stream::MediaStreamManager* media_stream_manager_; | |
233 AudioManager* audio_manager_; | |
234 }; | 224 }; |
235 | 225 |
236 typedef base::hash_map<std::string, scoped_refptr<ChromeURLRequestContext> > | 226 typedef base::hash_map<std::string, scoped_refptr<ChromeURLRequestContext> > |
237 AppRequestContextMap; | 227 AppRequestContextMap; |
238 | 228 |
239 // -------------------------------------------- | 229 // -------------------------------------------- |
240 // Virtual interface for subtypes to implement: | 230 // Virtual interface for subtypes to implement: |
241 // -------------------------------------------- | 231 // -------------------------------------------- |
242 | 232 |
243 // Does the actual initialization of the ProfileIOData subtype. Subtypes | 233 // Does the actual initialization of the ProfileIOData subtype. Subtypes |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 chrome_url_data_manager_backend_; | 270 chrome_url_data_manager_backend_; |
281 mutable scoped_ptr<net::OriginBoundCertService> origin_bound_cert_service_; | 271 mutable scoped_ptr<net::OriginBoundCertService> origin_bound_cert_service_; |
282 mutable scoped_ptr<net::NetworkDelegate> network_delegate_; | 272 mutable scoped_ptr<net::NetworkDelegate> network_delegate_; |
283 mutable scoped_ptr<net::FraudulentCertificateReporter> | 273 mutable scoped_ptr<net::FraudulentCertificateReporter> |
284 fraudulent_certificate_reporter_; | 274 fraudulent_certificate_reporter_; |
285 mutable scoped_ptr<net::ProxyService> proxy_service_; | 275 mutable scoped_ptr<net::ProxyService> proxy_service_; |
286 mutable scoped_ptr<net::TransportSecurityState> transport_security_state_; | 276 mutable scoped_ptr<net::TransportSecurityState> transport_security_state_; |
287 mutable scoped_ptr<net::URLRequestJobFactory> job_factory_; | 277 mutable scoped_ptr<net::URLRequestJobFactory> job_factory_; |
288 | 278 |
289 // Pointed to by ResourceContext. | 279 // Pointed to by ResourceContext. |
290 mutable scoped_ptr<media_stream::MediaStreamManager> media_stream_manager_; | |
291 | 280 |
292 // TODO(willchan): Remove from ResourceContext. | 281 // TODO(willchan): Remove from ResourceContext. |
293 mutable scoped_refptr<ExtensionInfoMap> extension_info_map_; | 282 mutable scoped_refptr<ExtensionInfoMap> extension_info_map_; |
294 mutable scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 283 mutable scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
295 mutable scoped_refptr<CookieSettings> cookie_settings_; | 284 mutable scoped_refptr<CookieSettings> cookie_settings_; |
296 mutable DesktopNotificationService* notification_service_; | 285 mutable DesktopNotificationService* notification_service_; |
297 | 286 |
298 mutable ResourceContext resource_context_; | 287 mutable ResourceContext resource_context_; |
299 | 288 |
300 mutable scoped_ptr<TransportSecurityPersister> | 289 mutable scoped_ptr<TransportSecurityPersister> |
301 transport_security_persister_; | 290 transport_security_persister_; |
302 | 291 |
303 // These are only valid in between LazyInitialize() and their accessor being | 292 // These are only valid in between LazyInitialize() and their accessor being |
304 // called. | 293 // called. |
305 mutable scoped_refptr<ChromeURLRequestContext> main_request_context_; | 294 mutable scoped_refptr<ChromeURLRequestContext> main_request_context_; |
306 mutable scoped_refptr<ChromeURLRequestContext> extensions_request_context_; | 295 mutable scoped_refptr<ChromeURLRequestContext> extensions_request_context_; |
307 // One AppRequestContext per isolated app. | 296 // One AppRequestContext per isolated app. |
308 mutable AppRequestContextMap app_request_context_map_; | 297 mutable AppRequestContextMap app_request_context_map_; |
309 | 298 |
310 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. | 299 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. |
311 bool initialized_on_UI_thread_; | 300 bool initialized_on_UI_thread_; |
312 | 301 |
313 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); | 302 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); |
314 }; | 303 }; |
315 | 304 |
316 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 305 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
OLD | NEW |