| 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" |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/synchronization/lock.h" | 16 #include "base/synchronization/lock.h" |
| 17 #include "chrome/browser/api/prefs/pref_member.h" | 17 #include "chrome/browser/api/prefs/pref_member.h" |
| 18 #include "chrome/browser/io_thread.h" | 18 #include "chrome/browser/io_thread.h" |
| 19 #include "chrome/browser/net/chrome_url_request_context.h" | 19 #include "chrome/browser/net/chrome_url_request_context.h" |
| 20 #include "content/public/browser/resource_context.h" | 20 #include "content/public/browser/resource_context.h" |
| 21 #include "net/cookies/cookie_monster.h" | 21 #include "net/cookies/cookie_monster.h" |
| 22 #include "net/http/http_network_session.h" | 22 #include "net/http/http_network_session.h" |
| 23 #include "net/url_request/url_request_job_factory.h" | 23 #include "net/url_request/url_request_job_factory.h" |
| 24 | 24 |
| 25 class ChromeHttpUserAgentSettings; |
| 25 class CookieSettings; | 26 class CookieSettings; |
| 26 class DesktopNotificationService; | 27 class DesktopNotificationService; |
| 27 class ExtensionInfoMap; | 28 class ExtensionInfoMap; |
| 28 class HostContentSettingsMap; | 29 class HostContentSettingsMap; |
| 29 class Profile; | 30 class Profile; |
| 30 class ProtocolHandlerRegistry; | 31 class ProtocolHandlerRegistry; |
| 31 class TransportSecurityPersister; | 32 class TransportSecurityPersister; |
| 32 | 33 |
| 33 namespace chrome_browser_net { | 34 namespace chrome_browser_net { |
| 34 class LoadTimeStats; | 35 class LoadTimeStats; |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 scoped_ptr<net::URLRequestJobFactory> job_factory_; | 178 scoped_ptr<net::URLRequestJobFactory> job_factory_; |
| 178 }; | 179 }; |
| 179 | 180 |
| 180 // Created on the UI thread, read on the IO thread during ProfileIOData lazy | 181 // Created on the UI thread, read on the IO thread during ProfileIOData lazy |
| 181 // initialization. | 182 // initialization. |
| 182 struct ProfileParams { | 183 struct ProfileParams { |
| 183 ProfileParams(); | 184 ProfileParams(); |
| 184 ~ProfileParams(); | 185 ~ProfileParams(); |
| 185 | 186 |
| 186 FilePath path; | 187 FilePath path; |
| 187 std::string accept_language; | |
| 188 std::string accept_charset; | |
| 189 std::string referrer_charset; | 188 std::string referrer_charset; |
| 190 IOThread* io_thread; | 189 IOThread* io_thread; |
| 191 scoped_refptr<CookieSettings> cookie_settings; | 190 scoped_refptr<CookieSettings> cookie_settings; |
| 192 scoped_refptr<net::SSLConfigService> ssl_config_service; | 191 scoped_refptr<net::SSLConfigService> ssl_config_service; |
| 193 scoped_refptr<net::CookieMonster::Delegate> cookie_monster_delegate; | 192 scoped_refptr<net::CookieMonster::Delegate> cookie_monster_delegate; |
| 194 scoped_refptr<ExtensionInfoMap> extension_info_map; | 193 scoped_refptr<ExtensionInfoMap> extension_info_map; |
| 195 scoped_ptr<chrome_browser_net::ResourcePrefetchPredictorObserver> | 194 scoped_ptr<chrome_browser_net::ResourcePrefetchPredictorObserver> |
| 196 resource_prefetch_predictor_observer_; | 195 resource_prefetch_predictor_observer_; |
| 197 | 196 |
| 198 #if defined(ENABLE_NOTIFICATIONS) | 197 #if defined(ENABLE_NOTIFICATIONS) |
| 199 DesktopNotificationService* notification_service; | 198 DesktopNotificationService* notification_service; |
| 200 #endif | 199 #endif |
| 201 | 200 |
| 202 // This pointer exists only as a means of conveying a url interceptor | 201 // This pointer exists only as a means of conveying a url interceptor |
| 203 // pointer from the protocol handler registry on the UI thread to the | 202 // pointer from the protocol handler registry on the UI thread to the |
| 204 // the URLRequestJobFactory on the IO thread. The consumer MUST take | 203 // the URLRequestJobFactory on the IO thread. The consumer MUST take |
| 205 // ownership of the object by calling release() on this pointer. | 204 // ownership of the object by calling release() on this pointer. |
| 206 scoped_ptr<net::URLRequestJobFactory::Interceptor> | 205 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| 207 protocol_handler_interceptor; | 206 protocol_handler_interceptor; |
| 208 | 207 |
| 209 // We need to initialize the ProxyConfigService from the UI thread | 208 // We need to initialize the ProxyConfigService from the UI thread |
| 210 // because on linux it relies on initializing things through gconf, | 209 // because on linux it relies on initializing things through gconf, |
| 211 // and needs to be on the main thread. | 210 // and needs to be on the main thread. |
| 212 scoped_ptr<net::ProxyConfigService> proxy_config_service; | 211 scoped_ptr<net::ProxyConfigService> proxy_config_service; |
| 212 // We need to initialize the ChromeHttpUserAgentSettings on the UI thread |
| 213 // so it can sign up for notifications from the PrefService. |
| 214 scoped_ptr<ChromeHttpUserAgentSettings> chrome_http_user_agent_settings; |
| 213 // The profile this struct was populated from. It's passed as a void* to | 215 // The profile this struct was populated from. It's passed as a void* to |
| 214 // ensure it's not accidently used on the IO thread. Before using it on the | 216 // ensure it's not accidently used on the IO thread. Before using it on the |
| 215 // UI thread, call ProfileManager::IsValidProfile to ensure it's alive. | 217 // UI thread, call ProfileManager::IsValidProfile to ensure it's alive. |
| 216 void* profile; | 218 void* profile; |
| 217 }; | 219 }; |
| 218 | 220 |
| 219 explicit ProfileIOData(bool is_incognito); | 221 explicit ProfileIOData(bool is_incognito); |
| 220 | 222 |
| 221 static std::string GetSSLSessionCacheShard(); | 223 static std::string GetSSLSessionCacheShard(); |
| 222 | 224 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 mutable URLRequestContextMap app_request_context_map_; | 420 mutable URLRequestContextMap app_request_context_map_; |
| 419 mutable URLRequestContextMap isolated_media_request_context_map_; | 421 mutable URLRequestContextMap isolated_media_request_context_map_; |
| 420 | 422 |
| 421 mutable scoped_ptr<ResourceContext> resource_context_; | 423 mutable scoped_ptr<ResourceContext> resource_context_; |
| 422 | 424 |
| 423 mutable scoped_refptr<CookieSettings> cookie_settings_; | 425 mutable scoped_refptr<CookieSettings> cookie_settings_; |
| 424 | 426 |
| 425 mutable scoped_ptr<chrome_browser_net::ResourcePrefetchPredictorObserver> | 427 mutable scoped_ptr<chrome_browser_net::ResourcePrefetchPredictorObserver> |
| 426 resource_prefetch_predictor_observer_; | 428 resource_prefetch_predictor_observer_; |
| 427 | 429 |
| 430 mutable scoped_ptr<ChromeHttpUserAgentSettings> |
| 431 chrome_http_user_agent_settings_; |
| 432 |
| 428 mutable chrome_browser_net::LoadTimeStats* load_time_stats_; | 433 mutable chrome_browser_net::LoadTimeStats* load_time_stats_; |
| 429 | 434 |
| 430 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. | 435 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. |
| 431 bool initialized_on_UI_thread_; | 436 bool initialized_on_UI_thread_; |
| 432 | 437 |
| 433 bool is_incognito_; | 438 bool is_incognito_; |
| 434 | 439 |
| 435 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); | 440 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); |
| 436 }; | 441 }; |
| 437 | 442 |
| 438 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 443 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
| OLD | NEW |