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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 #include "chrome/browser/chromeos/login/user_manager.h" | 96 #include "chrome/browser/chromeos/login/user_manager.h" |
97 #include "chrome/browser/chromeos/policy/policy_cert_service.h" | 97 #include "chrome/browser/chromeos/policy/policy_cert_service.h" |
98 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" | 98 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" |
99 #include "chrome/browser/chromeos/policy/policy_cert_verifier.h" | 99 #include "chrome/browser/chromeos/policy/policy_cert_verifier.h" |
100 #include "chrome/browser/chromeos/settings/cros_settings.h" | 100 #include "chrome/browser/chromeos/settings/cros_settings.h" |
101 #include "chromeos/dbus/cryptohome_client.h" | 101 #include "chromeos/dbus/cryptohome_client.h" |
102 #include "chromeos/dbus/dbus_thread_manager.h" | 102 #include "chromeos/dbus/dbus_thread_manager.h" |
103 #include "chromeos/settings/cros_settings_names.h" | 103 #include "chromeos/settings/cros_settings_names.h" |
104 #include "crypto/nss_util.h" | 104 #include "crypto/nss_util.h" |
105 #include "crypto/nss_util_internal.h" | 105 #include "crypto/nss_util_internal.h" |
| 106 #include "net/cert/cert_verify_proc_chromeos.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 net::CertVerifyProcChromeOS(public_slot.Pass(), |
| 972 crypto::ScopedPK11Slot()); |
963 if (cert_verifier_) { | 973 if (cert_verifier_) { |
964 cert_verifier_->InitializeOnIOThread(); | 974 cert_verifier_->InitializeOnIOThread(verify_proc.get()); |
965 main_request_context_->set_cert_verifier(cert_verifier_.get()); | 975 main_request_context_->set_cert_verifier(cert_verifier_.get()); |
966 } else { | 976 } else { |
967 main_request_context_->set_cert_verifier( | 977 main_request_context_->set_cert_verifier( |
968 io_thread_globals->cert_verifier.get()); | 978 new net::MultiThreadedCertVerifier(verify_proc.get())); |
969 } | 979 } |
970 username_hash_ = profile_params_->username_hash; | |
971 #else | 980 #else |
972 main_request_context_->set_cert_verifier( | 981 main_request_context_->set_cert_verifier( |
973 io_thread_globals->cert_verifier.get()); | 982 io_thread_globals->cert_verifier.get()); |
974 #endif | 983 #endif |
975 | 984 |
976 InitializeInternal(profile_params_.get(), protocol_handlers); | 985 InitializeInternal(profile_params_.get(), protocol_handlers); |
977 | 986 |
978 profile_params_.reset(); | 987 profile_params_.reset(); |
979 initialized_ = true; | 988 initialized_ = true; |
980 } | 989 } |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1123 void ProfileIOData::SetCookieSettingsForTesting( | 1132 void ProfileIOData::SetCookieSettingsForTesting( |
1124 CookieSettings* cookie_settings) { | 1133 CookieSettings* cookie_settings) { |
1125 DCHECK(!cookie_settings_.get()); | 1134 DCHECK(!cookie_settings_.get()); |
1126 cookie_settings_ = cookie_settings; | 1135 cookie_settings_ = cookie_settings; |
1127 } | 1136 } |
1128 | 1137 |
1129 void ProfileIOData::set_signin_names_for_testing( | 1138 void ProfileIOData::set_signin_names_for_testing( |
1130 SigninNamesOnIOThread* signin_names) { | 1139 SigninNamesOnIOThread* signin_names) { |
1131 signin_names_.reset(signin_names); | 1140 signin_names_.reset(signin_names); |
1132 } | 1141 } |
OLD | NEW |