| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 | 506 |
| 507 network_prediction_options_.Init(prefs::kNetworkPredictionOptions, | 507 network_prediction_options_.Init(prefs::kNetworkPredictionOptions, |
| 508 pref_service); | 508 pref_service); |
| 509 | 509 |
| 510 network_prediction_options_.MoveToThread(io_task_runner); | 510 network_prediction_options_.MoveToThread(io_task_runner); |
| 511 | 511 |
| 512 #if defined(OS_CHROMEOS) | 512 #if defined(OS_CHROMEOS) |
| 513 scoped_ptr<policy::PolicyCertVerifier> verifier = | 513 scoped_ptr<policy::PolicyCertVerifier> verifier = |
| 514 policy::PolicyCertServiceFactory::CreateForProfile(profile); | 514 policy::PolicyCertServiceFactory::CreateForProfile(profile); |
| 515 policy_cert_verifier_ = verifier.get(); | 515 policy_cert_verifier_ = verifier.get(); |
| 516 cert_verifier_ = verifier.Pass(); | 516 cert_verifier_ = std::move(verifier); |
| 517 #endif | 517 #endif |
| 518 // The URLBlacklistManager has to be created on the UI thread to register | 518 // The URLBlacklistManager has to be created on the UI thread to register |
| 519 // observers of |pref_service|, and it also has to clean up on | 519 // observers of |pref_service|, and it also has to clean up on |
| 520 // ShutdownOnUIThread to release these observers on the right thread. | 520 // ShutdownOnUIThread to release these observers on the right thread. |
| 521 // Don't pass it in |profile_params_| to make sure it is correctly cleaned up, | 521 // Don't pass it in |profile_params_| to make sure it is correctly cleaned up, |
| 522 // in particular when this ProfileIOData isn't |initialized_| during deletion. | 522 // in particular when this ProfileIOData isn't |initialized_| during deletion. |
| 523 #if defined(ENABLE_CONFIGURATION_POLICY) | 523 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 524 policy::URLBlacklist::SegmentURLCallback callback = | 524 policy::URLBlacklist::SegmentURLCallback callback = |
| 525 static_cast<policy::URLBlacklist::SegmentURLCallback>( | 525 static_cast<policy::URLBlacklist::SegmentURLCallback>( |
| 526 url_formatter::SegmentURL); | 526 url_formatter::SegmentURL); |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 #if defined(ENABLE_SUPERVISED_USERS) | 1090 #if defined(ENABLE_SUPERVISED_USERS) |
| 1091 supervised_user_url_filter_ = profile_params_->supervised_user_url_filter; | 1091 supervised_user_url_filter_ = profile_params_->supervised_user_url_filter; |
| 1092 #endif | 1092 #endif |
| 1093 | 1093 |
| 1094 #if defined(OS_CHROMEOS) | 1094 #if defined(OS_CHROMEOS) |
| 1095 username_hash_ = profile_params_->username_hash; | 1095 username_hash_ = profile_params_->username_hash; |
| 1096 use_system_key_slot_ = profile_params_->use_system_key_slot; | 1096 use_system_key_slot_ = profile_params_->use_system_key_slot; |
| 1097 if (use_system_key_slot_) | 1097 if (use_system_key_slot_) |
| 1098 EnableNSSSystemKeySlotForResourceContext(resource_context_.get()); | 1098 EnableNSSSystemKeySlotForResourceContext(resource_context_.get()); |
| 1099 | 1099 |
| 1100 certificate_provider_ = profile_params_->certificate_provider.Pass(); | 1100 certificate_provider_ = std::move(profile_params_->certificate_provider); |
| 1101 #endif | 1101 #endif |
| 1102 | 1102 |
| 1103 if (g_cert_verifier_for_testing) { | 1103 if (g_cert_verifier_for_testing) { |
| 1104 main_request_context_->set_cert_verifier(g_cert_verifier_for_testing); | 1104 main_request_context_->set_cert_verifier(g_cert_verifier_for_testing); |
| 1105 } else { | 1105 } else { |
| 1106 #if defined(OS_CHROMEOS) | 1106 #if defined(OS_CHROMEOS) |
| 1107 crypto::ScopedPK11Slot public_slot = | 1107 crypto::ScopedPK11Slot public_slot = |
| 1108 crypto::GetPublicSlotForChromeOSUser(username_hash_); | 1108 crypto::GetPublicSlotForChromeOSUser(username_hash_); |
| 1109 // The private slot won't be ready by this point. It shouldn't be necessary | 1109 // The private slot won't be ready by this point. It shouldn't be necessary |
| 1110 // for cert trust purposes anyway. | 1110 // for cert trust purposes anyway. |
| 1111 scoped_refptr<net::CertVerifyProc> verify_proc( | 1111 scoped_refptr<net::CertVerifyProc> verify_proc( |
| 1112 new chromeos::CertVerifyProcChromeOS(public_slot.Pass())); | 1112 new chromeos::CertVerifyProcChromeOS(std::move(public_slot))); |
| 1113 if (policy_cert_verifier_) { | 1113 if (policy_cert_verifier_) { |
| 1114 DCHECK_EQ(policy_cert_verifier_, cert_verifier_.get()); | 1114 DCHECK_EQ(policy_cert_verifier_, cert_verifier_.get()); |
| 1115 policy_cert_verifier_->InitializeOnIOThread(verify_proc); | 1115 policy_cert_verifier_->InitializeOnIOThread(verify_proc); |
| 1116 } else { | 1116 } else { |
| 1117 cert_verifier_.reset( | 1117 cert_verifier_.reset( |
| 1118 new net::MultiThreadedCertVerifier(verify_proc.get())); | 1118 new net::MultiThreadedCertVerifier(verify_proc.get())); |
| 1119 } | 1119 } |
| 1120 main_request_context_->set_cert_verifier(cert_verifier_.get()); | 1120 main_request_context_->set_cert_verifier(cert_verifier_.get()); |
| 1121 #else | 1121 #else |
| 1122 main_request_context_->set_cert_verifier( | 1122 main_request_context_->set_cert_verifier( |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1322 make_scoped_ptr(new DevToolsNetworkTransactionFactory( | 1322 make_scoped_ptr(new DevToolsNetworkTransactionFactory( |
| 1323 network_controller_handle_.GetController(), shared_session)), | 1323 network_controller_handle_.GetController(), shared_session)), |
| 1324 std::move(backend), true /* set_up_quic_server_info */)); | 1324 std::move(backend), true /* set_up_quic_server_info */)); |
| 1325 } | 1325 } |
| 1326 | 1326 |
| 1327 void ProfileIOData::SetCookieSettingsForTesting( | 1327 void ProfileIOData::SetCookieSettingsForTesting( |
| 1328 content_settings::CookieSettings* cookie_settings) { | 1328 content_settings::CookieSettings* cookie_settings) { |
| 1329 DCHECK(!cookie_settings_.get()); | 1329 DCHECK(!cookie_settings_.get()); |
| 1330 cookie_settings_ = cookie_settings; | 1330 cookie_settings_ = cookie_settings; |
| 1331 } | 1331 } |
| OLD | NEW |