OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chromeos/network/network_cert_migrator.h" | 5 #include "chromeos/network/network_cert_migrator.h" |
6 | 6 |
7 #include <cert.h> | 7 #include <cert.h> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 180 |
181 void NetworkCertMigrator::NetworkListChanged() { | 181 void NetworkCertMigrator::NetworkListChanged() { |
182 if (!CertLoader::Get()->certificates_loaded()) { | 182 if (!CertLoader::Get()->certificates_loaded()) { |
183 VLOG(2) << "Certs not loaded yet."; | 183 VLOG(2) << "Certs not loaded yet."; |
184 return; | 184 return; |
185 } | 185 } |
186 // Run the migration process to fix missing or incorrect slot ids of client | 186 // Run the migration process to fix missing or incorrect slot ids of client |
187 // certificates. | 187 // certificates. |
188 VLOG(2) << "Start certificate migration of network configurations."; | 188 VLOG(2) << "Start certificate migration of network configurations."; |
189 scoped_refptr<MigrationTask> helper(new MigrationTask( | 189 scoped_refptr<MigrationTask> helper(new MigrationTask( |
190 CertLoader::Get()->cert_list(), weak_ptr_factory_.GetWeakPtr())); | 190 CertLoader::Get()->all_certs(), weak_ptr_factory_.GetWeakPtr())); |
191 NetworkStateHandler::NetworkStateList networks; | 191 NetworkStateHandler::NetworkStateList networks; |
192 network_state_handler_->GetNetworkListByType( | 192 network_state_handler_->GetNetworkListByType( |
193 NetworkTypePattern::Default(), | 193 NetworkTypePattern::Default(), |
194 true, // only configured networks | 194 true, // only configured networks |
195 false, // visible and not visible networks | 195 false, // visible and not visible networks |
196 0, // no count limit | 196 0, // no count limit |
197 &networks); | 197 &networks); |
198 helper->Run(networks); | 198 helper->Run(networks); |
199 } | 199 } |
200 | 200 |
201 void NetworkCertMigrator::OnCertificatesLoaded( | 201 void NetworkCertMigrator::OnCertificatesLoaded( |
202 const net::CertificateList& cert_list, | 202 const net::CertificateList& cert_list, |
203 bool initial_load) { | 203 bool initial_load) { |
204 if (initial_load) | 204 if (initial_load) |
205 NetworkListChanged(); | 205 NetworkListChanged(); |
206 } | 206 } |
207 | 207 |
208 } // namespace chromeos | 208 } // namespace chromeos |
OLD | NEW |