profile_io_data.h revision ca12bfac764ba476d6cd062bf1dde12cc64c3f40
1a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved. 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file. 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 51320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#ifndef CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ 65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ 75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <string> 95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/basictypes.h" 115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/callback_forward.h" 125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/files/file_path.h" 135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/memory/ref_counted.h" 142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/memory/scoped_ptr.h" 152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/memory/weak_ptr.h" 162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/prefs/pref_member.h" 172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/synchronization/lock.h" 182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/custom_handlers/protocol_handler_registry.h" 195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/browser/io_thread.h" 205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/browser/net/chrome_url_request_context.h" 215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/browser/profiles/storage_partition_descriptor.h" 225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/public/browser/content_browser_client.h" 235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/public/browser/resource_context.h" 241320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#include "net/cookies/cookie_monster.h" 252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "net/http/http_network_session.h" 262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "net/url_request/url_request_job_factory.h" 275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class ChromeHttpUserAgentSettings; 295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class ChromeNetworkDelegate; 305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class CookieSettings; 315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class DesktopNotificationService; 325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class ExtensionInfoMap; 335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class HostContentSettingsMap; 345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class ManagedModeURLFilter; 352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class Profile; 362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class ProtocolHandlerRegistry; 372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class SigninNamesOnIOThread; 382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class TransportSecurityPersister; 392a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 402a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace chrome_browser_net { 412a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class LoadTimeStats; 425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class ResourcePrefetchPredictorObserver; 435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} 445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace net { 465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class CertTrustAnchorProvider; 475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class CertVerifier; 485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class CookieStore; 495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class FraudulentCertificateReporter; 505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class FtpTransactionFactory; 515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class HttpServerProperties; 525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class HttpTransactionFactory; 535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class ServerBoundCertService; 545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class ProxyConfigService; 555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class ProxyService; 565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class SSLConfigService; 575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class TransportSecurityState; 585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class URLRequestJobFactoryImpl; 595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} // namespace net 605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace policy { 625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class URLBlacklistManager; 635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} // namespace policy 645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Conceptually speaking, the ProfileIOData represents data that lives on the IO 665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// thread that is owned by a Profile, such as, but not limited to, network 675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// objects like CookieMonster, HttpTransactionFactory, etc. Profile owns 685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// ProfileIOData, but will make sure to delete it on the IO thread (except 695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// possibly in unit tests where there is no IO thread). 705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class ProfileIOData { 715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public: 725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual ~ProfileIOData(); 735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) static ProfileIOData* FromResourceContext(content::ResourceContext* rc); 755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Returns true if |scheme| is handled in Chrome, or by default handlers in 775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // net::URLRequest. 785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) static bool IsHandledProtocol(const std::string& scheme); 795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Returns true if |url| is handled in Chrome, or by default handlers in 815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // net::URLRequest. 825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) static bool IsHandledURL(const GURL& url); 835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Utility to install additional WebUI handlers into the |job_factory|. 855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Ownership of the handlers is transfered from |protocol_handlers| 865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // to the |job_factory|. 875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) static void InstallProtocolHandlers( 885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) net::URLRequestJobFactoryImpl* job_factory, 892a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) content::ProtocolHandlerMap* protocol_handlers); 902a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 912a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Called by Profile. 922a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) content::ResourceContext* GetResourceContext() const; 932a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 942a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Initializes the ProfileIOData object and primes the RequestContext 955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // generation. Must be called prior to any of the Get*() methods other than 96 // GetResouceContext or GetMetricsEnabledStateOnIOThread. 97 void Init(content::ProtocolHandlerMap* protocol_handlers) const; 98 99 ChromeURLRequestContext* GetMainRequestContext() const; 100 ChromeURLRequestContext* GetMediaRequestContext() const; 101 ChromeURLRequestContext* GetExtensionsRequestContext() const; 102 ChromeURLRequestContext* GetIsolatedAppRequestContext( 103 ChromeURLRequestContext* main_context, 104 const StoragePartitionDescriptor& partition_descriptor, 105 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> 106 protocol_handler_interceptor, 107 content::ProtocolHandlerMap* protocol_handlers) const; 108 ChromeURLRequestContext* GetIsolatedMediaRequestContext( 109 ChromeURLRequestContext* app_context, 110 const StoragePartitionDescriptor& partition_descriptor) const; 111 112 // These are useful when the Chrome layer is called from the content layer 113 // with a content::ResourceContext, and they want access to Chrome data for 114 // that profile. 115 ExtensionInfoMap* GetExtensionInfoMap() const; 116 CookieSettings* GetCookieSettings() const; 117 118#if defined(ENABLE_NOTIFICATIONS) 119 DesktopNotificationService* GetNotificationService() const; 120#endif 121 122 IntegerPrefMember* session_startup_pref() const { 123 return &session_startup_pref_; 124 } 125 126 SigninNamesOnIOThread* signin_names() const { 127 return signin_names_.get(); 128 } 129 130 StringPrefMember* google_services_username() const { 131 return &google_services_username_; 132 } 133 134 StringPrefMember* google_services_username_pattern() const { 135 return &google_services_username_pattern_; 136 } 137 138 BooleanPrefMember* reverse_autologin_enabled() const { 139 return &reverse_autologin_enabled_; 140 } 141 142 const std::string& reverse_autologin_pending_email() const { 143 return reverse_autologin_pending_email_; 144 } 145 146 void set_reverse_autologin_pending_email(const std::string& email) { 147 reverse_autologin_pending_email_ = email; 148 } 149 150 StringListPrefMember* one_click_signin_rejected_email_list() const { 151 return &one_click_signin_rejected_email_list_; 152 } 153 154 ChromeURLRequestContext* extensions_request_context() const { 155 return extensions_request_context_.get(); 156 } 157 158 BooleanPrefMember* safe_browsing_enabled() const { 159 return &safe_browsing_enabled_; 160 } 161 162 BooleanPrefMember* printing_enabled() const { 163 return &printing_enabled_; 164 } 165 166 BooleanPrefMember* sync_disabled() const { 167 return &sync_disabled_; 168 } 169 170 BooleanPrefMember* signin_allowed() const { 171 return &signin_allowed_; 172 } 173 174 net::TransportSecurityState* transport_security_state() const { 175 return transport_security_state_.get(); 176 } 177 178 bool is_incognito() const { 179 return is_incognito_; 180 } 181 182 chrome_browser_net::ResourcePrefetchPredictorObserver* 183 resource_prefetch_predictor_observer() const { 184 return resource_prefetch_predictor_observer_.get(); 185 } 186 187#if defined(ENABLE_MANAGED_USERS) 188 const ManagedModeURLFilter* managed_mode_url_filter() const { 189 return managed_mode_url_filter_.get(); 190 } 191#endif 192 193 // Initialize the member needed to track the metrics enabled state. This is 194 // only to be called on the UI thread. 195 void InitializeMetricsEnabledStateOnUIThread(); 196 197 // Returns whether or not metrics reporting is enabled in the browser instance 198 // on which this profile resides. This is safe for use from the IO thread, and 199 // should only be called from there. 200 bool GetMetricsEnabledStateOnIOThread() const; 201 202 protected: 203 // A URLRequestContext for media that owns its HTTP factory, to ensure 204 // it is deleted. 205 class MediaRequestContext : public ChromeURLRequestContext { 206 public: 207 explicit MediaRequestContext( 208 chrome_browser_net::LoadTimeStats* load_time_stats); 209 210 void SetHttpTransactionFactory( 211 scoped_ptr<net::HttpTransactionFactory> http_factory); 212 213 private: 214 virtual ~MediaRequestContext(); 215 216 scoped_ptr<net::HttpTransactionFactory> http_factory_; 217 }; 218 219 // A URLRequestContext for apps that owns its cookie store and HTTP factory, 220 // to ensure they are deleted. 221 class AppRequestContext : public ChromeURLRequestContext { 222 public: 223 explicit AppRequestContext( 224 chrome_browser_net::LoadTimeStats* load_time_stats); 225 226 void SetCookieStore(net::CookieStore* cookie_store); 227 void SetHttpTransactionFactory( 228 scoped_ptr<net::HttpTransactionFactory> http_factory); 229 void SetJobFactory(scoped_ptr<net::URLRequestJobFactory> job_factory); 230 231 private: 232 virtual ~AppRequestContext(); 233 234 scoped_refptr<net::CookieStore> cookie_store_; 235 scoped_ptr<net::HttpTransactionFactory> http_factory_; 236 scoped_ptr<net::URLRequestJobFactory> job_factory_; 237 }; 238 239 // Created on the UI thread, read on the IO thread during ProfileIOData lazy 240 // initialization. 241 struct ProfileParams { 242 ProfileParams(); 243 ~ProfileParams(); 244 245 base::FilePath path; 246 IOThread* io_thread; 247 scoped_refptr<CookieSettings> cookie_settings; 248 scoped_refptr<net::SSLConfigService> ssl_config_service; 249 scoped_refptr<net::CookieMonster::Delegate> cookie_monster_delegate; 250 scoped_refptr<ExtensionInfoMap> extension_info_map; 251 scoped_ptr<chrome_browser_net::ResourcePrefetchPredictorObserver> 252 resource_prefetch_predictor_observer_; 253 254#if defined(ENABLE_NOTIFICATIONS) 255 DesktopNotificationService* notification_service; 256#endif 257 258 // This pointer exists only as a means of conveying a url job factory 259 // pointer from the protocol handler registry on the UI thread to the 260 // the URLRequestContext on the IO thread. The consumer MUST take 261 // ownership of the object by calling release() on this pointer. 262 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> 263 protocol_handler_interceptor; 264 265 // We need to initialize the ProxyConfigService from the UI thread 266 // because on linux it relies on initializing things through gconf, 267 // and needs to be on the main thread. 268 scoped_ptr<net::ProxyConfigService> proxy_config_service; 269 270#if defined(ENABLE_MANAGED_USERS) 271 scoped_refptr<const ManagedModeURLFilter> managed_mode_url_filter; 272#endif 273 274#if defined(OS_CHROMEOS) 275 // This is used to build the CertVerifier on the IO thread, and is a shared 276 // provider used by all profiles for now. 277 net::CertTrustAnchorProvider* trust_anchor_provider; 278#endif 279 280 // The profile this struct was populated from. It's passed as a void* to 281 // ensure it's not accidently used on the IO thread. Before using it on the 282 // UI thread, call ProfileManager::IsValidProfile to ensure it's alive. 283 void* profile; 284 }; 285 286 explicit ProfileIOData(bool is_incognito); 287 288 static std::string GetSSLSessionCacheShard(); 289 290 void InitializeOnUIThread(Profile* profile); 291 void ApplyProfileParamsToContext(ChromeURLRequestContext* context) const; 292 293 scoped_ptr<net::URLRequestJobFactory> SetUpJobFactoryDefaults( 294 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory, 295 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> 296 protocol_handler_interceptor, 297 net::NetworkDelegate* network_delegate, 298 net::FtpTransactionFactory* ftp_transaction_factory) const; 299 300 // Called when the profile is destroyed. 301 void ShutdownOnUIThread(); 302 303 // A ServerBoundCertService object is created by a derived class of 304 // ProfileIOData, and the derived class calls this method to set the 305 // server_bound_cert_service_ member and transfers ownership to the base 306 // class. 307 void set_server_bound_cert_service( 308 net::ServerBoundCertService* server_bound_cert_service) const; 309 310 ChromeNetworkDelegate* network_delegate() const { 311 return network_delegate_.get(); 312 } 313 314 net::FraudulentCertificateReporter* fraudulent_certificate_reporter() const { 315 return fraudulent_certificate_reporter_.get(); 316 } 317 318 net::ProxyService* proxy_service() const { 319 return proxy_service_.get(); 320 } 321 322 base::WeakPtr<net::HttpServerProperties> http_server_properties() const; 323 324 void set_http_server_properties( 325 scoped_ptr<net::HttpServerProperties> http_server_properties) const; 326 327 ChromeURLRequestContext* main_request_context() const { 328 return main_request_context_.get(); 329 } 330 331 chrome_browser_net::LoadTimeStats* load_time_stats() const { 332 return load_time_stats_; 333 } 334 335 bool initialized() const { 336 return initialized_; 337 } 338 339 // Destroys the ResourceContext first, to cancel any URLRequests that are 340 // using it still, before we destroy the member variables that those 341 // URLRequests may be accessing. 342 void DestroyResourceContext(); 343 344 // Fills in fields of params using values from main_request_context_ and the 345 // IOThread associated with profile_params. 346 void PopulateNetworkSessionParams( 347 const ProfileParams* profile_params, 348 net::HttpNetworkSession::Params* params) const; 349 350 void SetCookieSettingsForTesting(CookieSettings* cookie_settings); 351 352 void set_signin_names_for_testing(SigninNamesOnIOThread* signin_names); 353 354 private: 355 class ResourceContext : public content::ResourceContext { 356 public: 357 explicit ResourceContext(ProfileIOData* io_data); 358 virtual ~ResourceContext(); 359 360 // ResourceContext implementation: 361 virtual net::HostResolver* GetHostResolver() OVERRIDE; 362 virtual net::URLRequestContext* GetRequestContext() OVERRIDE; 363 364 private: 365 friend class ProfileIOData; 366 367 ProfileIOData* const io_data_; 368 369 net::HostResolver* host_resolver_; 370 net::URLRequestContext* request_context_; 371 }; 372 373 typedef std::map<StoragePartitionDescriptor, 374 ChromeURLRequestContext*, 375 StoragePartitionDescriptorLess> 376 URLRequestContextMap; 377 378 // -------------------------------------------- 379 // Virtual interface for subtypes to implement: 380 // -------------------------------------------- 381 382 // Does the actual initialization of the ProfileIOData subtype. Subtypes 383 // should use the static helper functions above to implement this. 384 virtual void InitializeInternal( 385 ProfileParams* profile_params, 386 content::ProtocolHandlerMap* protocol_handlers) const = 0; 387 388 // Initializes the RequestContext for extensions. 389 virtual void InitializeExtensionsRequestContext( 390 ProfileParams* profile_params) const = 0; 391 // Does an on-demand initialization of a RequestContext for the given 392 // isolated app. 393 virtual ChromeURLRequestContext* InitializeAppRequestContext( 394 ChromeURLRequestContext* main_context, 395 const StoragePartitionDescriptor& details, 396 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> 397 protocol_handler_interceptor, 398 content::ProtocolHandlerMap* protocol_handlers) const = 0; 399 400 // Does an on-demand initialization of a media RequestContext for the given 401 // isolated app. 402 virtual ChromeURLRequestContext* InitializeMediaRequestContext( 403 ChromeURLRequestContext* original_context, 404 const StoragePartitionDescriptor& details) const = 0; 405 406 // These functions are used to transfer ownership of the lazily initialized 407 // context from ProfileIOData to the URLRequestContextGetter. 408 virtual ChromeURLRequestContext* 409 AcquireMediaRequestContext() const = 0; 410 virtual ChromeURLRequestContext* 411 AcquireIsolatedAppRequestContext( 412 ChromeURLRequestContext* main_context, 413 const StoragePartitionDescriptor& partition_descriptor, 414 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> 415 protocol_handler_interceptor, 416 content::ProtocolHandlerMap* protocol_handlers) const = 0; 417 virtual ChromeURLRequestContext* 418 AcquireIsolatedMediaRequestContext( 419 ChromeURLRequestContext* app_context, 420 const StoragePartitionDescriptor& partition_descriptor) const = 0; 421 422 // Returns the LoadTimeStats object to be used for this profile. 423 virtual chrome_browser_net::LoadTimeStats* GetLoadTimeStats( 424 IOThread::Globals* io_thread_globals) const = 0; 425 426 // The order *DOES* matter for the majority of these member variables, so 427 // don't move them around unless you know what you're doing! 428 // General rules: 429 // * ResourceContext references the URLRequestContexts, so 430 // URLRequestContexts must outlive ResourceContext, hence ResourceContext 431 // should be destroyed first. 432 // * URLRequestContexts reference a whole bunch of members, so 433 // URLRequestContext needs to be destroyed before them. 434 // * Therefore, ResourceContext should be listed last, and then the 435 // URLRequestContexts, and then the URLRequestContext members. 436 // * Note that URLRequestContext members have a directed dependency graph 437 // too, so they must themselves be ordered correctly. 438 439 // Tracks whether or not we've been lazily initialized. 440 mutable bool initialized_; 441 442 // Data from the UI thread from the Profile, used to initialize ProfileIOData. 443 // Deleted after lazy initialization. 444 mutable scoped_ptr<ProfileParams> profile_params_; 445 446 // Provides access to the email addresses of all signed in profiles. 447 mutable scoped_ptr<SigninNamesOnIOThread> signin_names_; 448 449 mutable StringPrefMember google_services_username_; 450 mutable StringPrefMember google_services_username_pattern_; 451 mutable BooleanPrefMember reverse_autologin_enabled_; 452 453 // During the reverse autologin request chain processing, this member saves 454 // the email of the google account that is being signed into. 455 std::string reverse_autologin_pending_email_; 456 457 mutable StringListPrefMember one_click_signin_rejected_email_list_; 458 459 // Member variables which are pointed to by the various context objects. 460 mutable BooleanPrefMember enable_referrers_; 461 mutable BooleanPrefMember enable_do_not_track_; 462 mutable BooleanPrefMember force_safesearch_; 463 mutable BooleanPrefMember safe_browsing_enabled_; 464 mutable BooleanPrefMember printing_enabled_; 465 mutable BooleanPrefMember sync_disabled_; 466 mutable BooleanPrefMember signin_allowed_; 467 // TODO(marja): Remove session_startup_pref_ if no longer needed. 468 mutable IntegerPrefMember session_startup_pref_; 469 470 // The state of metrics reporting in the browser that this profile runs on. 471 // Unfortunately, since ChromeOS has a separate representation of this state, 472 // we need to make one available based on the platform. 473#if defined(OS_CHROMEOS) 474 bool enable_metrics_; 475#else 476 BooleanPrefMember enable_metrics_; 477#endif 478 479 // Pointed to by NetworkDelegate. 480 mutable scoped_ptr<policy::URLBlacklistManager> url_blacklist_manager_; 481 482 // Pointed to by URLRequestContext. 483 mutable scoped_refptr<ExtensionInfoMap> extension_info_map_; 484 mutable scoped_ptr<net::ServerBoundCertService> server_bound_cert_service_; 485 mutable scoped_ptr<ChromeNetworkDelegate> network_delegate_; 486 mutable scoped_ptr<net::FraudulentCertificateReporter> 487 fraudulent_certificate_reporter_; 488 mutable scoped_ptr<net::ProxyService> proxy_service_; 489 mutable scoped_ptr<net::TransportSecurityState> transport_security_state_; 490 mutable scoped_ptr<net::HttpServerProperties> 491 http_server_properties_; 492#if defined(OS_CHROMEOS) 493 mutable scoped_ptr<net::CertVerifier> cert_verifier_; 494#endif 495 496#if defined(ENABLE_NOTIFICATIONS) 497 mutable DesktopNotificationService* notification_service_; 498#endif 499 500 mutable scoped_ptr<TransportSecurityPersister> 501 transport_security_persister_; 502 503 // These are only valid in between LazyInitialize() and their accessor being 504 // called. 505 mutable scoped_ptr<ChromeURLRequestContext> main_request_context_; 506 mutable scoped_ptr<ChromeURLRequestContext> extensions_request_context_; 507 // One URLRequestContext per isolated app for main and media requests. 508 mutable URLRequestContextMap app_request_context_map_; 509 mutable URLRequestContextMap isolated_media_request_context_map_; 510 511 mutable scoped_ptr<ResourceContext> resource_context_; 512 513 mutable scoped_refptr<CookieSettings> cookie_settings_; 514 515 mutable scoped_ptr<chrome_browser_net::ResourcePrefetchPredictorObserver> 516 resource_prefetch_predictor_observer_; 517 518 mutable scoped_ptr<ChromeHttpUserAgentSettings> 519 chrome_http_user_agent_settings_; 520 521 mutable chrome_browser_net::LoadTimeStats* load_time_stats_; 522 523#if defined(ENABLE_MANAGED_USERS) 524 mutable scoped_refptr<const ManagedModeURLFilter> managed_mode_url_filter_; 525#endif 526 527 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. 528 bool initialized_on_UI_thread_; 529 530 bool is_incognito_; 531 532 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); 533}; 534 535#endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ 536