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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 #if defined(ENABLE_MANAGED_USERS) | 87 #if defined(ENABLE_MANAGED_USERS) |
88 #include "chrome/browser/managed_mode/managed_mode_url_filter.h" | 88 #include "chrome/browser/managed_mode/managed_mode_url_filter.h" |
89 #include "chrome/browser/managed_mode/managed_user_service.h" | 89 #include "chrome/browser/managed_mode/managed_user_service.h" |
90 #include "chrome/browser/managed_mode/managed_user_service_factory.h" | 90 #include "chrome/browser/managed_mode/managed_user_service_factory.h" |
91 #endif | 91 #endif |
92 | 92 |
93 #if defined(OS_CHROMEOS) | 93 #if defined(OS_CHROMEOS) |
94 #include "chrome/browser/chromeos/drive/drive_protocol_handler.h" | 94 #include "chrome/browser/chromeos/drive/drive_protocol_handler.h" |
95 #include "chrome/browser/chromeos/login/user.h" | 95 #include "chrome/browser/chromeos/login/user.h" |
96 #include "chrome/browser/chromeos/login/user_manager.h" | 96 #include "chrome/browser/chromeos/login/user_manager.h" |
97 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h" | |
97 #include "chrome/browser/chromeos/policy/policy_cert_service.h" | 98 #include "chrome/browser/chromeos/policy/policy_cert_service.h" |
98 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" | 99 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" |
99 #include "chrome/browser/chromeos/policy/policy_cert_verifier.h" | 100 #include "chrome/browser/chromeos/policy/policy_cert_verifier.h" |
100 #include "chrome/browser/chromeos/settings/cros_settings.h" | 101 #include "chrome/browser/chromeos/settings/cros_settings.h" |
101 #include "chromeos/dbus/cryptohome_client.h" | 102 #include "chromeos/dbus/cryptohome_client.h" |
102 #include "chromeos/dbus/dbus_thread_manager.h" | 103 #include "chromeos/dbus/dbus_thread_manager.h" |
103 #include "chromeos/settings/cros_settings_names.h" | 104 #include "chromeos/settings/cros_settings_names.h" |
104 #include "crypto/nss_util.h" | 105 #include "crypto/nss_util.h" |
105 #include "crypto/nss_util_internal.h" | 106 #include "crypto/nss_util_internal.h" |
107 #include "net/cert/multi_threaded_cert_verifier.h" | |
106 #include "net/ssl/client_cert_store_chromeos.h" | 108 #include "net/ssl/client_cert_store_chromeos.h" |
107 #endif // defined(OS_CHROMEOS) | 109 #endif // defined(OS_CHROMEOS) |
108 | 110 |
109 #if defined(USE_NSS) | 111 #if defined(USE_NSS) |
110 #include "chrome/browser/ui/crypto_module_delegate_nss.h" | 112 #include "chrome/browser/ui/crypto_module_delegate_nss.h" |
111 #include "net/ssl/client_cert_store_nss.h" | 113 #include "net/ssl/client_cert_store_nss.h" |
112 #endif | 114 #endif |
113 | 115 |
114 #if defined(OS_WIN) | 116 #if defined(OS_WIN) |
115 #include "net/ssl/client_cert_store_win.h" | 117 #include "net/ssl/client_cert_store_win.h" |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
953 extension_info_map_ = profile_params_->extension_info_map; | 955 extension_info_map_ = profile_params_->extension_info_map; |
954 | 956 |
955 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get(); | 957 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get(); |
956 resource_context_->request_context_ = main_request_context_.get(); | 958 resource_context_->request_context_ = main_request_context_.get(); |
957 | 959 |
958 #if defined(ENABLE_MANAGED_USERS) | 960 #if defined(ENABLE_MANAGED_USERS) |
959 managed_mode_url_filter_ = profile_params_->managed_mode_url_filter; | 961 managed_mode_url_filter_ = profile_params_->managed_mode_url_filter; |
960 #endif | 962 #endif |
961 | 963 |
962 #if defined(OS_CHROMEOS) | 964 #if defined(OS_CHROMEOS) |
965 username_hash_ = profile_params_->username_hash; | |
966 crypto::ScopedPK11Slot public_slot = | |
967 crypto::GetPublicSlotForChromeOSUser(username_hash_); | |
968 // Private slot won't be ready by this point, just pass NULL. It shouldn't be | |
969 // necessary for cert trust purposes anyway. | |
970 scoped_refptr<net::CertVerifyProc> verify_proc = | |
971 new chromeos::CertVerifyProcChromeOS(public_slot.Pass()); | |
963 if (cert_verifier_) { | 972 if (cert_verifier_) { |
964 cert_verifier_->InitializeOnIOThread(); | 973 cert_verifier_->InitializeOnIOThread(verify_proc.get()); |
965 main_request_context_->set_cert_verifier(cert_verifier_.get()); | 974 main_request_context_->set_cert_verifier(cert_verifier_.get()); |
966 } else { | 975 } else { |
967 main_request_context_->set_cert_verifier( | 976 main_request_context_->set_cert_verifier( |
968 io_thread_globals->cert_verifier.get()); | 977 new net::MultiThreadedCertVerifier(verify_proc.get())); |
Ryan Sleevi
2014/01/30 05:27:40
Why are you not using the io_thread_globals here?
mattm
2014/02/04 05:31:21
Even if it's not using a PolicyCertVerifier for so
| |
969 } | 978 } |
970 username_hash_ = profile_params_->username_hash; | |
971 #else | 979 #else |
972 main_request_context_->set_cert_verifier( | 980 main_request_context_->set_cert_verifier( |
973 io_thread_globals->cert_verifier.get()); | 981 io_thread_globals->cert_verifier.get()); |
974 #endif | 982 #endif |
975 | 983 |
976 InitializeInternal(profile_params_.get(), protocol_handlers); | 984 InitializeInternal(profile_params_.get(), protocol_handlers); |
977 | 985 |
978 profile_params_.reset(); | 986 profile_params_.reset(); |
979 initialized_ = true; | 987 initialized_ = true; |
980 } | 988 } |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1123 void ProfileIOData::SetCookieSettingsForTesting( | 1131 void ProfileIOData::SetCookieSettingsForTesting( |
1124 CookieSettings* cookie_settings) { | 1132 CookieSettings* cookie_settings) { |
1125 DCHECK(!cookie_settings_.get()); | 1133 DCHECK(!cookie_settings_.get()); |
1126 cookie_settings_ = cookie_settings; | 1134 cookie_settings_ = cookie_settings; |
1127 } | 1135 } |
1128 | 1136 |
1129 void ProfileIOData::set_signin_names_for_testing( | 1137 void ProfileIOData::set_signin_names_for_testing( |
1130 SigninNamesOnIOThread* signin_names) { | 1138 SigninNamesOnIOThread* signin_names) { |
1131 signin_names_.reset(signin_names); | 1139 signin_names_.reset(signin_names); |
1132 } | 1140 } |
OLD | NEW |