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 #include "chrome/browser/profiles/profile_io_data.h" | 5 #include "chrome/browser/profiles/profile_io_data.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 // chromeos::TPMTokenInfoGetter::Start | 256 // chromeos::TPMTokenInfoGetter::Start |
257 // | | 257 // | |
258 // DidGetTPMInfoForUserOnUIThread | 258 // DidGetTPMInfoForUserOnUIThread |
259 // \---------------------------------------v | 259 // \---------------------------------------v |
260 // crypto::InitializeTPMForChromeOSUser | 260 // crypto::InitializeTPMForChromeOSUser |
261 | 261 |
262 void DidGetTPMInfoForUserOnUIThread( | 262 void DidGetTPMInfoForUserOnUIThread( |
263 scoped_ptr<chromeos::TPMTokenInfoGetter> getter, | 263 scoped_ptr<chromeos::TPMTokenInfoGetter> getter, |
264 const std::string& username_hash, | 264 const std::string& username_hash, |
265 const chromeos::TPMTokenInfo& info) { | 265 const chromeos::TPMTokenInfo& info) { |
266 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 266 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
267 if (info.tpm_is_enabled && info.token_slot_id != -1) { | 267 if (info.tpm_is_enabled && info.token_slot_id != -1) { |
268 DVLOG(1) << "Got TPM slot for " << username_hash << ": " | 268 DVLOG(1) << "Got TPM slot for " << username_hash << ": " |
269 << info.token_slot_id; | 269 << info.token_slot_id; |
270 BrowserThread::PostTask( | 270 BrowserThread::PostTask( |
271 BrowserThread::IO, | 271 BrowserThread::IO, |
272 FROM_HERE, | 272 FROM_HERE, |
273 base::Bind(&crypto::InitializeTPMForChromeOSUser, | 273 base::Bind(&crypto::InitializeTPMForChromeOSUser, |
274 username_hash, info.token_slot_id)); | 274 username_hash, info.token_slot_id)); |
275 } else { | 275 } else { |
276 NOTREACHED() << "TPMTokenInfoGetter reported invalid token."; | 276 NOTREACHED() << "TPMTokenInfoGetter reported invalid token."; |
277 } | 277 } |
278 } | 278 } |
279 | 279 |
280 void GetTPMInfoForUserOnUIThread(const std::string& username, | 280 void GetTPMInfoForUserOnUIThread(const std::string& username, |
281 const std::string& username_hash) { | 281 const std::string& username_hash) { |
282 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 282 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
283 DVLOG(1) << "Getting TPM info from cryptohome for " | 283 DVLOG(1) << "Getting TPM info from cryptohome for " |
284 << " " << username << " " << username_hash; | 284 << " " << username << " " << username_hash; |
285 scoped_ptr<chromeos::TPMTokenInfoGetter> scoped_token_info_getter = | 285 scoped_ptr<chromeos::TPMTokenInfoGetter> scoped_token_info_getter = |
286 chromeos::TPMTokenInfoGetter::CreateForUserToken( | 286 chromeos::TPMTokenInfoGetter::CreateForUserToken( |
287 username, | 287 username, |
288 chromeos::DBusThreadManager::Get()->GetCryptohomeClient(), | 288 chromeos::DBusThreadManager::Get()->GetCryptohomeClient(), |
289 base::ThreadTaskRunnerHandle::Get()); | 289 base::ThreadTaskRunnerHandle::Get()); |
290 chromeos::TPMTokenInfoGetter* token_info_getter = | 290 chromeos::TPMTokenInfoGetter* token_info_getter = |
291 scoped_token_info_getter.get(); | 291 scoped_token_info_getter.get(); |
292 | 292 |
293 // Bind |token_info_getter| to the callback to ensure it does not go away | 293 // Bind |token_info_getter| to the callback to ensure it does not go away |
294 // before TPM token info is fetched. | 294 // before TPM token info is fetched. |
295 // TODO(tbarzic, pneubeck): Handle this in a nicer way when this logic is | 295 // TODO(tbarzic, pneubeck): Handle this in a nicer way when this logic is |
296 // moved to a separate profile service. | 296 // moved to a separate profile service. |
297 token_info_getter->Start( | 297 token_info_getter->Start( |
298 base::Bind(&DidGetTPMInfoForUserOnUIThread, | 298 base::Bind(&DidGetTPMInfoForUserOnUIThread, |
299 base::Passed(&scoped_token_info_getter), | 299 base::Passed(&scoped_token_info_getter), |
300 username_hash)); | 300 username_hash)); |
301 } | 301 } |
302 | 302 |
303 void StartTPMSlotInitializationOnIOThread(const std::string& username, | 303 void StartTPMSlotInitializationOnIOThread(const std::string& username, |
304 const std::string& username_hash) { | 304 const std::string& username_hash) { |
305 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 305 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
306 | 306 |
307 BrowserThread::PostTask( | 307 BrowserThread::PostTask( |
308 BrowserThread::UI, | 308 BrowserThread::UI, |
309 FROM_HERE, | 309 FROM_HERE, |
310 base::Bind(&GetTPMInfoForUserOnUIThread, username, username_hash)); | 310 base::Bind(&GetTPMInfoForUserOnUIThread, username, username_hash)); |
311 } | 311 } |
312 | 312 |
313 void StartNSSInitOnIOThread(const std::string& username, | 313 void StartNSSInitOnIOThread(const std::string& username, |
314 const std::string& username_hash, | 314 const std::string& username_hash, |
315 const base::FilePath& path) { | 315 const base::FilePath& path) { |
316 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 316 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
317 DVLOG(1) << "Starting NSS init for " << username | 317 DVLOG(1) << "Starting NSS init for " << username |
318 << " hash:" << username_hash; | 318 << " hash:" << username_hash; |
319 | 319 |
320 // Make sure NSS is initialized for the user. | 320 // Make sure NSS is initialized for the user. |
321 crypto::InitializeNSSForChromeOSUser(username_hash, path); | 321 crypto::InitializeNSSForChromeOSUser(username_hash, path); |
322 | 322 |
323 // Check if it's OK to initialize TPM for the user before continuing. This | 323 // Check if it's OK to initialize TPM for the user before continuing. This |
324 // may not be the case if the TPM slot initialization was previously | 324 // may not be the case if the TPM slot initialization was previously |
325 // requested for the same user. | 325 // requested for the same user. |
326 if (!crypto::ShouldInitializeTPMForChromeOSUser(username_hash)) | 326 if (!crypto::ShouldInitializeTPMForChromeOSUser(username_hash)) |
(...skipping 20 matching lines...) Expand all Loading... |
347 const base::Callback<void(scoped_ptr<net::KeygenHandler>)>& callback, | 347 const base::Callback<void(scoped_ptr<net::KeygenHandler>)>& callback, |
348 scoped_ptr<ChromeNSSCryptoModuleDelegate> delegate) { | 348 scoped_ptr<ChromeNSSCryptoModuleDelegate> delegate) { |
349 if (delegate) | 349 if (delegate) |
350 keygen_handler->set_crypto_module_delegate(delegate.Pass()); | 350 keygen_handler->set_crypto_module_delegate(delegate.Pass()); |
351 callback.Run(keygen_handler.Pass()); | 351 callback.Run(keygen_handler.Pass()); |
352 } | 352 } |
353 #endif // defined(USE_NSS_CERTS) | 353 #endif // defined(USE_NSS_CERTS) |
354 | 354 |
355 void InvalidateContextGettersOnIO( | 355 void InvalidateContextGettersOnIO( |
356 scoped_ptr<ProfileIOData::ChromeURLRequestContextGetterVector> getters) { | 356 scoped_ptr<ProfileIOData::ChromeURLRequestContextGetterVector> getters) { |
357 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 357 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
358 ProfileIOData::ChromeURLRequestContextGetterVector::iterator iter; | 358 ProfileIOData::ChromeURLRequestContextGetterVector::iterator iter; |
359 for (iter = getters->begin(); iter != getters->end(); ++iter) | 359 for (iter = getters->begin(); iter != getters->end(); ++iter) |
360 (*iter)->Invalidate(); | 360 (*iter)->Invalidate(); |
361 } | 361 } |
362 | 362 |
363 } // namespace | 363 } // namespace |
364 | 364 |
365 void ProfileIOData::InitializeOnUIThread(Profile* profile) { | 365 void ProfileIOData::InitializeOnUIThread(Profile* profile) { |
366 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 366 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
367 PrefService* pref_service = profile->GetPrefs(); | 367 PrefService* pref_service = profile->GetPrefs(); |
368 PrefService* local_state_pref_service = g_browser_process->local_state(); | 368 PrefService* local_state_pref_service = g_browser_process->local_state(); |
369 | 369 |
370 scoped_ptr<ProfileParams> params(new ProfileParams); | 370 scoped_ptr<ProfileParams> params(new ProfileParams); |
371 params->path = profile->GetPath(); | 371 params->path = profile->GetPath(); |
372 | 372 |
373 params->io_thread = g_browser_process->io_thread(); | 373 params->io_thread = g_browser_process->io_thread(); |
374 | 374 |
375 params->cookie_settings = CookieSettings::Factory::GetForProfile(profile); | 375 params->cookie_settings = CookieSettings::Factory::GetForProfile(profile); |
376 params->host_content_settings_map = profile->GetHostContentSettingsMap(); | 376 params->host_content_settings_map = profile->GetHostContentSettingsMap(); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 | 588 |
589 ProfileIOData::ProfileIOData(Profile::ProfileType profile_type) | 589 ProfileIOData::ProfileIOData(Profile::ProfileType profile_type) |
590 : initialized_(false), | 590 : initialized_(false), |
591 #if defined(OS_CHROMEOS) | 591 #if defined(OS_CHROMEOS) |
592 policy_cert_verifier_(NULL), | 592 policy_cert_verifier_(NULL), |
593 use_system_key_slot_(false), | 593 use_system_key_slot_(false), |
594 #endif | 594 #endif |
595 resource_context_(new ResourceContext(this)), | 595 resource_context_(new ResourceContext(this)), |
596 initialized_on_UI_thread_(false), | 596 initialized_on_UI_thread_(false), |
597 profile_type_(profile_type) { | 597 profile_type_(profile_type) { |
598 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 598 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
599 } | 599 } |
600 | 600 |
601 ProfileIOData::~ProfileIOData() { | 601 ProfileIOData::~ProfileIOData() { |
602 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) | 602 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) |
603 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 603 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
604 | 604 |
605 // Pull the contents of the request context maps onto the stack for sanity | 605 // Pull the contents of the request context maps onto the stack for sanity |
606 // checking of values in a minidump. http://crbug.com/260425 | 606 // checking of values in a minidump. http://crbug.com/260425 |
607 size_t num_app_contexts = app_request_context_map_.size(); | 607 size_t num_app_contexts = app_request_context_map_.size(); |
608 size_t num_media_contexts = isolated_media_request_context_map_.size(); | 608 size_t num_media_contexts = isolated_media_request_context_map_.size(); |
609 size_t current_context = 0; | 609 size_t current_context = 0; |
610 static const size_t kMaxCachedContexts = 20; | 610 static const size_t kMaxCachedContexts = 20; |
611 net::URLRequestContext* app_context_cache[kMaxCachedContexts] = {0}; | 611 net::URLRequestContext* app_context_cache[kMaxCachedContexts] = {0}; |
612 void* app_context_vtable_cache[kMaxCachedContexts] = {0}; | 612 void* app_context_vtable_cache[kMaxCachedContexts] = {0}; |
613 net::URLRequestContext* media_context_cache[kMaxCachedContexts] = {0}; | 613 net::URLRequestContext* media_context_cache[kMaxCachedContexts] = {0}; |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 ResourceContext::SaltCallback ProfileIOData::GetMediaDeviceIDSalt() const { | 825 ResourceContext::SaltCallback ProfileIOData::GetMediaDeviceIDSalt() const { |
826 return base::Bind(&MediaDeviceIDSalt::GetSalt, media_device_id_salt_); | 826 return base::Bind(&MediaDeviceIDSalt::GetSalt, media_device_id_salt_); |
827 } | 827 } |
828 | 828 |
829 bool ProfileIOData::IsOffTheRecord() const { | 829 bool ProfileIOData::IsOffTheRecord() const { |
830 return profile_type() == Profile::INCOGNITO_PROFILE | 830 return profile_type() == Profile::INCOGNITO_PROFILE |
831 || profile_type() == Profile::GUEST_PROFILE; | 831 || profile_type() == Profile::GUEST_PROFILE; |
832 } | 832 } |
833 | 833 |
834 void ProfileIOData::InitializeMetricsEnabledStateOnUIThread() { | 834 void ProfileIOData::InitializeMetricsEnabledStateOnUIThread() { |
835 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 835 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
836 #if defined(OS_CHROMEOS) | 836 #if defined(OS_CHROMEOS) |
837 // Just fetch the value from ChromeOS' settings while we're on the UI thread. | 837 // Just fetch the value from ChromeOS' settings while we're on the UI thread. |
838 // TODO(stevet): For now, this value is only set on profile initialization. | 838 // TODO(stevet): For now, this value is only set on profile initialization. |
839 // We will want to do something similar to the PrefMember method below in the | 839 // We will want to do something similar to the PrefMember method below in the |
840 // future to more accurately capture this state. | 840 // future to more accurately capture this state. |
841 chromeos::CrosSettings::Get()->GetBoolean(chromeos::kStatsReportingPref, | 841 chromeos::CrosSettings::Get()->GetBoolean(chromeos::kStatsReportingPref, |
842 &enable_metrics_); | 842 &enable_metrics_); |
843 #elif defined(OS_ANDROID) | 843 #elif defined(OS_ANDROID) |
844 // TODO(dwkang): rename or unify the pref for UMA once we have conclusion | 844 // TODO(dwkang): rename or unify the pref for UMA once we have conclusion |
845 // in crbugs.com/246495. | 845 // in crbugs.com/246495. |
846 // Android has it's own preferences for metrics / crash uploading. | 846 // Android has it's own preferences for metrics / crash uploading. |
847 enable_metrics_.Init(prefs::kCrashReportingEnabled, | 847 enable_metrics_.Init(prefs::kCrashReportingEnabled, |
848 g_browser_process->local_state()); | 848 g_browser_process->local_state()); |
849 enable_metrics_.MoveToThread( | 849 enable_metrics_.MoveToThread( |
850 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 850 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
851 #else | 851 #else |
852 // Prep the PrefMember and send it to the IO thread, since this value will be | 852 // Prep the PrefMember and send it to the IO thread, since this value will be |
853 // read from there. | 853 // read from there. |
854 enable_metrics_.Init(prefs::kMetricsReportingEnabled, | 854 enable_metrics_.Init(prefs::kMetricsReportingEnabled, |
855 g_browser_process->local_state()); | 855 g_browser_process->local_state()); |
856 enable_metrics_.MoveToThread( | 856 enable_metrics_.MoveToThread( |
857 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 857 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
858 #endif // defined(OS_CHROMEOS) | 858 #endif // defined(OS_CHROMEOS) |
859 } | 859 } |
860 | 860 |
861 bool ProfileIOData::GetMetricsEnabledStateOnIOThread() const { | 861 bool ProfileIOData::GetMetricsEnabledStateOnIOThread() const { |
862 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 862 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
863 #if defined(OS_CHROMEOS) | 863 #if defined(OS_CHROMEOS) |
864 return enable_metrics_; | 864 return enable_metrics_; |
865 #else | 865 #else |
866 return enable_metrics_.GetValue(); | 866 return enable_metrics_.GetValue(); |
867 #endif // defined(OS_CHROMEOS) | 867 #endif // defined(OS_CHROMEOS) |
868 } | 868 } |
869 | 869 |
870 bool ProfileIOData::IsDataReductionProxyEnabled() const { | 870 bool ProfileIOData::IsDataReductionProxyEnabled() const { |
871 return data_reduction_proxy_io_data()->IsEnabled(); | 871 return data_reduction_proxy_io_data()->IsEnabled(); |
872 } | 872 } |
(...skipping 17 matching lines...) Expand all Loading... |
890 ProfileIOData::ResourceContext::ResourceContext(ProfileIOData* io_data) | 890 ProfileIOData::ResourceContext::ResourceContext(ProfileIOData* io_data) |
891 : io_data_(io_data), | 891 : io_data_(io_data), |
892 host_resolver_(NULL), | 892 host_resolver_(NULL), |
893 request_context_(NULL) { | 893 request_context_(NULL) { |
894 DCHECK(io_data); | 894 DCHECK(io_data); |
895 } | 895 } |
896 | 896 |
897 ProfileIOData::ResourceContext::~ResourceContext() {} | 897 ProfileIOData::ResourceContext::~ResourceContext() {} |
898 | 898 |
899 net::HostResolver* ProfileIOData::ResourceContext::GetHostResolver() { | 899 net::HostResolver* ProfileIOData::ResourceContext::GetHostResolver() { |
900 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 900 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
901 DCHECK(io_data_->initialized_); | 901 DCHECK(io_data_->initialized_); |
902 return host_resolver_; | 902 return host_resolver_; |
903 } | 903 } |
904 | 904 |
905 net::URLRequestContext* ProfileIOData::ResourceContext::GetRequestContext() { | 905 net::URLRequestContext* ProfileIOData::ResourceContext::GetRequestContext() { |
906 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 906 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
907 DCHECK(io_data_->initialized_); | 907 DCHECK(io_data_->initialized_); |
908 return request_context_; | 908 return request_context_; |
909 } | 909 } |
910 | 910 |
911 scoped_ptr<net::ClientCertStore> | 911 scoped_ptr<net::ClientCertStore> |
912 ProfileIOData::ResourceContext::CreateClientCertStore() { | 912 ProfileIOData::ResourceContext::CreateClientCertStore() { |
913 if (!io_data_->client_cert_store_factory_.is_null()) | 913 if (!io_data_->client_cert_store_factory_.is_null()) |
914 return io_data_->client_cert_store_factory_.Run(); | 914 return io_data_->client_cert_store_factory_.Run(); |
915 #if defined(OS_CHROMEOS) | 915 #if defined(OS_CHROMEOS) |
916 return scoped_ptr<net::ClientCertStore>(new net::ClientCertStoreChromeOS( | 916 return scoped_ptr<net::ClientCertStore>(new net::ClientCertStoreChromeOS( |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 #endif | 962 #endif |
963 } | 963 } |
964 | 964 |
965 ResourceContext::SaltCallback | 965 ResourceContext::SaltCallback |
966 ProfileIOData::ResourceContext::GetMediaDeviceIDSalt() { | 966 ProfileIOData::ResourceContext::GetMediaDeviceIDSalt() { |
967 return io_data_->GetMediaDeviceIDSalt(); | 967 return io_data_->GetMediaDeviceIDSalt(); |
968 } | 968 } |
969 | 969 |
970 // static | 970 // static |
971 std::string ProfileIOData::GetSSLSessionCacheShard() { | 971 std::string ProfileIOData::GetSSLSessionCacheShard() { |
972 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 972 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
973 // The SSL session cache is partitioned by setting a string. This returns a | 973 // The SSL session cache is partitioned by setting a string. This returns a |
974 // unique string to partition the SSL session cache. Each time we create a | 974 // unique string to partition the SSL session cache. Each time we create a |
975 // new profile, we'll get a fresh SSL session cache which is separate from | 975 // new profile, we'll get a fresh SSL session cache which is separate from |
976 // the other profiles. | 976 // the other profiles. |
977 static unsigned ssl_session_cache_instance = 0; | 977 static unsigned ssl_session_cache_instance = 0; |
978 return base::StringPrintf("profile/%u", ssl_session_cache_instance++); | 978 return base::StringPrintf("profile/%u", ssl_session_cache_instance++); |
979 } | 979 } |
980 | 980 |
981 void ProfileIOData::Init( | 981 void ProfileIOData::Init( |
982 content::ProtocolHandlerMap* protocol_handlers, | 982 content::ProtocolHandlerMap* protocol_handlers, |
983 content::URLRequestInterceptorScopedVector request_interceptors) const { | 983 content::URLRequestInterceptorScopedVector request_interceptors) const { |
984 // The basic logic is implemented here. The specific initialization | 984 // The basic logic is implemented here. The specific initialization |
985 // is done in InitializeInternal(), implemented by subtypes. Static helper | 985 // is done in InitializeInternal(), implemented by subtypes. Static helper |
986 // functions have been provided to assist in common operations. | 986 // functions have been provided to assist in common operations. |
987 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 987 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
988 DCHECK(!initialized_); | 988 DCHECK(!initialized_); |
989 | 989 |
990 startup_metric_utils::ScopedSlowStartupUMA | 990 startup_metric_utils::ScopedSlowStartupUMA |
991 scoped_timer("Startup.SlowStartupProfileIODataInit"); | 991 scoped_timer("Startup.SlowStartupProfileIODataInit"); |
992 | 992 |
993 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. | 993 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. |
994 CHECK(initialized_on_UI_thread_); | 994 CHECK(initialized_on_UI_thread_); |
995 | 995 |
996 // TODO(jhawkins): Return to DCHECK once crbug.com/102004 is fixed. | 996 // TODO(jhawkins): Return to DCHECK once crbug.com/102004 is fixed. |
997 CHECK(profile_params_.get()); | 997 CHECK(profile_params_.get()); |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1193 if (protocol_handler_interceptor) { | 1193 if (protocol_handler_interceptor) { |
1194 protocol_handler_interceptor->Chain(top_job_factory.Pass()); | 1194 protocol_handler_interceptor->Chain(top_job_factory.Pass()); |
1195 return protocol_handler_interceptor.Pass(); | 1195 return protocol_handler_interceptor.Pass(); |
1196 } else { | 1196 } else { |
1197 return top_job_factory.Pass(); | 1197 return top_job_factory.Pass(); |
1198 } | 1198 } |
1199 } | 1199 } |
1200 | 1200 |
1201 void ProfileIOData::ShutdownOnUIThread( | 1201 void ProfileIOData::ShutdownOnUIThread( |
1202 scoped_ptr<ChromeURLRequestContextGetterVector> context_getters) { | 1202 scoped_ptr<ChromeURLRequestContextGetterVector> context_getters) { |
1203 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1203 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1204 | 1204 |
1205 if (signin_names_) | 1205 if (signin_names_) |
1206 signin_names_->ReleaseResourcesOnUIThread(); | 1206 signin_names_->ReleaseResourcesOnUIThread(); |
1207 | 1207 |
1208 google_services_user_account_id_.Destroy(); | 1208 google_services_user_account_id_.Destroy(); |
1209 enable_referrers_.Destroy(); | 1209 enable_referrers_.Destroy(); |
1210 enable_do_not_track_.Destroy(); | 1210 enable_do_not_track_.Destroy(); |
1211 force_google_safesearch_.Destroy(); | 1211 force_google_safesearch_.Destroy(); |
1212 force_youtube_safety_mode_.Destroy(); | 1212 force_youtube_safety_mode_.Destroy(); |
1213 #if !defined(OS_CHROMEOS) | 1213 #if !defined(OS_CHROMEOS) |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1297 void ProfileIOData::SetCookieSettingsForTesting( | 1297 void ProfileIOData::SetCookieSettingsForTesting( |
1298 CookieSettings* cookie_settings) { | 1298 CookieSettings* cookie_settings) { |
1299 DCHECK(!cookie_settings_.get()); | 1299 DCHECK(!cookie_settings_.get()); |
1300 cookie_settings_ = cookie_settings; | 1300 cookie_settings_ = cookie_settings; |
1301 } | 1301 } |
1302 | 1302 |
1303 void ProfileIOData::set_signin_names_for_testing( | 1303 void ProfileIOData::set_signin_names_for_testing( |
1304 SigninNamesOnIOThread* signin_names) { | 1304 SigninNamesOnIOThread* signin_names) { |
1305 signin_names_.reset(signin_names); | 1305 signin_names_.reset(signin_names); |
1306 } | 1306 } |
OLD | NEW |