| 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 IOThread* io_thread; | 188 IOThread* io_thread; |
| 190 scoped_refptr<CookieSettings> cookie_settings; | 189 scoped_refptr<CookieSettings> cookie_settings; |
| 191 scoped_refptr<net::SSLConfigService> ssl_config_service; | 190 scoped_refptr<net::SSLConfigService> ssl_config_service; |
| 192 scoped_refptr<net::CookieMonster::Delegate> cookie_monster_delegate; | 191 scoped_refptr<net::CookieMonster::Delegate> cookie_monster_delegate; |
| 193 scoped_refptr<ExtensionInfoMap> extension_info_map; | 192 scoped_refptr<ExtensionInfoMap> extension_info_map; |
| 194 scoped_ptr<chrome_browser_net::ResourcePrefetchPredictorObserver> | 193 scoped_ptr<chrome_browser_net::ResourcePrefetchPredictorObserver> |
| 195 resource_prefetch_predictor_observer_; | 194 resource_prefetch_predictor_observer_; |
| 196 | 195 |
| 197 #if defined(ENABLE_NOTIFICATIONS) | 196 #if defined(ENABLE_NOTIFICATIONS) |
| 198 DesktopNotificationService* notification_service; | 197 DesktopNotificationService* notification_service; |
| 199 #endif | 198 #endif |
| 200 | 199 |
| 201 // This pointer exists only as a means of conveying a url interceptor | 200 // This pointer exists only as a means of conveying a url interceptor |
| 202 // pointer from the protocol handler registry on the UI thread to the | 201 // pointer from the protocol handler registry on the UI thread to the |
| 203 // the URLRequestJobFactory on the IO thread. The consumer MUST take | 202 // the URLRequestJobFactory on the IO thread. The consumer MUST take |
| 204 // ownership of the object by calling release() on this pointer. | 203 // ownership of the object by calling release() on this pointer. |
| 205 scoped_ptr<net::URLRequestJobFactory::Interceptor> | 204 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| 206 protocol_handler_interceptor; | 205 protocol_handler_interceptor; |
| 207 | 206 |
| 208 // We need to initialize the ProxyConfigService from the UI thread | 207 // We need to initialize the ProxyConfigService from the UI thread |
| 209 // because on linux it relies on initializing things through gconf, | 208 // because on linux it relies on initializing things through gconf, |
| 210 // and needs to be on the main thread. | 209 // and needs to be on the main thread. |
| 211 scoped_ptr<net::ProxyConfigService> proxy_config_service; | 210 scoped_ptr<net::ProxyConfigService> proxy_config_service; |
| 211 // We need to initialize the ChromeHttpUserAgentSettings on the UI thread |
| 212 // so it can sign up for notifications from the PrefService. |
| 213 scoped_ptr<ChromeHttpUserAgentSettings> chrome_http_user_agent_settings; |
| 212 // The profile this struct was populated from. It's passed as a void* to | 214 // The profile this struct was populated from. It's passed as a void* to |
| 213 // ensure it's not accidently used on the IO thread. Before using it on the | 215 // ensure it's not accidently used on the IO thread. Before using it on the |
| 214 // UI thread, call ProfileManager::IsValidProfile to ensure it's alive. | 216 // UI thread, call ProfileManager::IsValidProfile to ensure it's alive. |
| 215 void* profile; | 217 void* profile; |
| 216 }; | 218 }; |
| 217 | 219 |
| 218 explicit ProfileIOData(bool is_incognito); | 220 explicit ProfileIOData(bool is_incognito); |
| 219 | 221 |
| 220 static std::string GetSSLSessionCacheShard(); | 222 static std::string GetSSLSessionCacheShard(); |
| 221 | 223 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 mutable URLRequestContextMap app_request_context_map_; | 419 mutable URLRequestContextMap app_request_context_map_; |
| 418 mutable URLRequestContextMap isolated_media_request_context_map_; | 420 mutable URLRequestContextMap isolated_media_request_context_map_; |
| 419 | 421 |
| 420 mutable scoped_ptr<ResourceContext> resource_context_; | 422 mutable scoped_ptr<ResourceContext> resource_context_; |
| 421 | 423 |
| 422 mutable scoped_refptr<CookieSettings> cookie_settings_; | 424 mutable scoped_refptr<CookieSettings> cookie_settings_; |
| 423 | 425 |
| 424 mutable scoped_ptr<chrome_browser_net::ResourcePrefetchPredictorObserver> | 426 mutable scoped_ptr<chrome_browser_net::ResourcePrefetchPredictorObserver> |
| 425 resource_prefetch_predictor_observer_; | 427 resource_prefetch_predictor_observer_; |
| 426 | 428 |
| 429 mutable scoped_ptr<ChromeHttpUserAgentSettings> |
| 430 chrome_http_user_agent_settings_; |
| 431 |
| 427 mutable chrome_browser_net::LoadTimeStats* load_time_stats_; | 432 mutable chrome_browser_net::LoadTimeStats* load_time_stats_; |
| 428 | 433 |
| 429 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. | 434 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. |
| 430 bool initialized_on_UI_thread_; | 435 bool initialized_on_UI_thread_; |
| 431 | 436 |
| 432 bool is_incognito_; | 437 bool is_incognito_; |
| 433 | 438 |
| 434 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); | 439 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); |
| 435 }; | 440 }; |
| 436 | 441 |
| 437 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 442 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
| OLD | NEW |