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 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 class CookieSettings; | 24 class CookieSettings; |
25 class DesktopNotificationService; | 25 class DesktopNotificationService; |
26 class ExtensionInfoMap; | 26 class ExtensionInfoMap; |
27 class HostContentSettingsMap; | 27 class HostContentSettingsMap; |
28 class Profile; | 28 class Profile; |
29 class ProtocolHandlerRegistry; | 29 class ProtocolHandlerRegistry; |
30 class TransportSecurityPersister; | 30 class TransportSecurityPersister; |
31 | 31 |
32 namespace chrome_browser_net { | 32 namespace chrome_browser_net { |
33 class CacheStats; | 33 class LoadTimeStats; |
34 class HttpServerPropertiesManager; | 34 class HttpServerPropertiesManager; |
35 class ResourcePrefetchPredictorObserver; | 35 class ResourcePrefetchPredictorObserver; |
36 } | 36 } |
37 | 37 |
38 namespace net { | 38 namespace net { |
39 class CookieStore; | 39 class CookieStore; |
40 class FraudulentCertificateReporter; | 40 class FraudulentCertificateReporter; |
41 class HttpTransactionFactory; | 41 class HttpTransactionFactory; |
42 class ServerBoundCertService; | 42 class ServerBoundCertService; |
43 class ProxyConfigService; | 43 class ProxyConfigService; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 void InitializeMetricsEnabledStateOnUIThread(); | 130 void InitializeMetricsEnabledStateOnUIThread(); |
131 | 131 |
132 // Returns whether or not metrics reporting is enabled in the browser instance | 132 // Returns whether or not metrics reporting is enabled in the browser instance |
133 // on which this profile resides. This is safe for use from the IO thread, and | 133 // on which this profile resides. This is safe for use from the IO thread, and |
134 // should only be called from there. | 134 // should only be called from there. |
135 bool GetMetricsEnabledStateOnIOThread() const; | 135 bool GetMetricsEnabledStateOnIOThread() const; |
136 | 136 |
137 protected: | 137 protected: |
138 class AppRequestContext : public ChromeURLRequestContext { | 138 class AppRequestContext : public ChromeURLRequestContext { |
139 public: | 139 public: |
140 explicit AppRequestContext(chrome_browser_net::CacheStats* cache_stats); | 140 explicit AppRequestContext( |
| 141 chrome_browser_net::LoadTimeStats* load_time_stats); |
141 | 142 |
142 void SetCookieStore(net::CookieStore* cookie_store); | 143 void SetCookieStore(net::CookieStore* cookie_store); |
143 void SetHttpTransactionFactory(net::HttpTransactionFactory* http_factory); | 144 void SetHttpTransactionFactory(net::HttpTransactionFactory* http_factory); |
144 | 145 |
145 private: | 146 private: |
146 virtual ~AppRequestContext(); | 147 virtual ~AppRequestContext(); |
147 | 148 |
148 scoped_refptr<net::CookieStore> cookie_store_; | 149 scoped_refptr<net::CookieStore> cookie_store_; |
149 scoped_ptr<net::HttpTransactionFactory> http_factory_; | 150 scoped_ptr<net::HttpTransactionFactory> http_factory_; |
150 }; | 151 }; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 return proxy_service_.get(); | 234 return proxy_service_.get(); |
234 } | 235 } |
235 | 236 |
236 void set_http_server_properties_manager( | 237 void set_http_server_properties_manager( |
237 chrome_browser_net::HttpServerPropertiesManager* manager) const; | 238 chrome_browser_net::HttpServerPropertiesManager* manager) const; |
238 | 239 |
239 ChromeURLRequestContext* main_request_context() const { | 240 ChromeURLRequestContext* main_request_context() const { |
240 return main_request_context_.get(); | 241 return main_request_context_.get(); |
241 } | 242 } |
242 | 243 |
243 chrome_browser_net::CacheStats* cache_stats() const { | 244 chrome_browser_net::LoadTimeStats* load_time_stats() const { |
244 return cache_stats_; | 245 return load_time_stats_; |
245 } | 246 } |
246 | 247 |
247 // Destroys the ResourceContext first, to cancel any URLRequests that are | 248 // Destroys the ResourceContext first, to cancel any URLRequests that are |
248 // using it still, before we destroy the member variables that those | 249 // using it still, before we destroy the member variables that those |
249 // URLRequests may be accessing. | 250 // URLRequests may be accessing. |
250 void DestroyResourceContext(); | 251 void DestroyResourceContext(); |
251 | 252 |
252 private: | 253 private: |
253 class ResourceContext : public content::ResourceContext { | 254 class ResourceContext : public content::ResourceContext { |
254 public: | 255 public: |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 | 290 |
290 // These functions are used to transfer ownership of the lazily initialized | 291 // These functions are used to transfer ownership of the lazily initialized |
291 // context from ProfileIOData to the URLRequestContextGetter. | 292 // context from ProfileIOData to the URLRequestContextGetter. |
292 virtual ChromeURLRequestContext* | 293 virtual ChromeURLRequestContext* |
293 AcquireMediaRequestContext() const = 0; | 294 AcquireMediaRequestContext() const = 0; |
294 virtual ChromeURLRequestContext* | 295 virtual ChromeURLRequestContext* |
295 AcquireIsolatedAppRequestContext( | 296 AcquireIsolatedAppRequestContext( |
296 ChromeURLRequestContext* main_context, | 297 ChromeURLRequestContext* main_context, |
297 const std::string& app_id) const = 0; | 298 const std::string& app_id) const = 0; |
298 | 299 |
299 // Returns the CacheStats object to be used for this profile. | 300 // Returns the LoadTimeStats object to be used for this profile. |
300 virtual chrome_browser_net::CacheStats* GetCacheStats( | 301 virtual chrome_browser_net::LoadTimeStats* GetLoadTimeStats( |
301 IOThread::Globals* io_thread_globals) const = 0; | 302 IOThread::Globals* io_thread_globals) const = 0; |
302 | 303 |
303 // The order *DOES* matter for the majority of these member variables, so | 304 // The order *DOES* matter for the majority of these member variables, so |
304 // don't move them around unless you know what you're doing! | 305 // don't move them around unless you know what you're doing! |
305 // General rules: | 306 // General rules: |
306 // * ResourceContext references the URLRequestContexts, so | 307 // * ResourceContext references the URLRequestContexts, so |
307 // URLRequestContexts must outlive ResourceContext, hence ResourceContext | 308 // URLRequestContexts must outlive ResourceContext, hence ResourceContext |
308 // should be destroyed first. | 309 // should be destroyed first. |
309 // * URLRequestContexts reference a whole bunch of members, so | 310 // * URLRequestContexts reference a whole bunch of members, so |
310 // URLRequestContext needs to be destroyed before them. | 311 // URLRequestContext needs to be destroyed before them. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 mutable AppRequestContextMap app_request_context_map_; | 367 mutable AppRequestContextMap app_request_context_map_; |
367 | 368 |
368 mutable scoped_ptr<ResourceContext> resource_context_; | 369 mutable scoped_ptr<ResourceContext> resource_context_; |
369 | 370 |
370 mutable scoped_refptr<ExtensionInfoMap> extension_info_map_; | 371 mutable scoped_refptr<ExtensionInfoMap> extension_info_map_; |
371 mutable scoped_refptr<CookieSettings> cookie_settings_; | 372 mutable scoped_refptr<CookieSettings> cookie_settings_; |
372 | 373 |
373 mutable scoped_ptr<chrome_browser_net::ResourcePrefetchPredictorObserver> | 374 mutable scoped_ptr<chrome_browser_net::ResourcePrefetchPredictorObserver> |
374 resource_prefetch_predictor_observer_; | 375 resource_prefetch_predictor_observer_; |
375 | 376 |
376 mutable chrome_browser_net::CacheStats* cache_stats_; | 377 mutable chrome_browser_net::LoadTimeStats* load_time_stats_; |
377 | 378 |
378 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. | 379 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. |
379 bool initialized_on_UI_thread_; | 380 bool initialized_on_UI_thread_; |
380 | 381 |
381 bool is_incognito_; | 382 bool is_incognito_; |
382 | 383 |
383 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); | 384 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); |
384 }; | 385 }; |
385 | 386 |
386 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 387 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
OLD | NEW |