| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos/platform_keys/platform_keys_service.h" | 5 #include "chrome/browser/chromeos/platform_keys/platform_keys_service.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 11 #include "base/callback.h" |
| 10 #include "base/values.h" | 12 #include "base/values.h" |
| 11 #include "chrome/browser/chromeos/platform_keys/platform_keys.h" | 13 #include "chrome/browser/chromeos/platform_keys/platform_keys.h" |
| 12 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 13 #include "extensions/browser/state_store.h" | 15 #include "extensions/browser/state_store.h" |
| 14 #include "net/cert/x509_certificate.h" | 16 #include "net/cert/x509_certificate.h" |
| 15 | 17 |
| 16 using content::BrowserThread; | 18 using content::BrowserThread; |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 net::X509Certificate::GetPublicKeyInfo( | 419 net::X509Certificate::GetPublicKeyInfo( |
| 418 certificate->os_cert_handle(), &unused_key_size, &actual_key_type); | 420 certificate->os_cert_handle(), &unused_key_size, &actual_key_type); |
| 419 const std::vector<net::X509Certificate::PublicKeyType>& accepted_types = | 421 const std::vector<net::X509Certificate::PublicKeyType>& accepted_types = |
| 420 request_.certificate_key_types; | 422 request_.certificate_key_types; |
| 421 if (std::find(accepted_types.begin(), accepted_types.end(), | 423 if (std::find(accepted_types.begin(), accepted_types.end(), |
| 422 actual_key_type) == accepted_types.end()) { | 424 actual_key_type) == accepted_types.end()) { |
| 423 continue; | 425 continue; |
| 424 } | 426 } |
| 425 } | 427 } |
| 426 | 428 |
| 427 matches_.push_back(certificate.Pass()); | 429 matches_.push_back(std::move(certificate)); |
| 428 } | 430 } |
| 429 DoStep(); | 431 DoStep(); |
| 430 } | 432 } |
| 431 | 433 |
| 432 // If |input_client_certificates_| is given, removes from |matches_| all | 434 // If |input_client_certificates_| is given, removes from |matches_| all |
| 433 // certificates that are not elements of |input_client_certificates_|. | 435 // certificates that are not elements of |input_client_certificates_|. |
| 434 void IntersectWithInputCerts() { | 436 void IntersectWithInputCerts() { |
| 435 if (!input_client_certificates_) { | 437 if (!input_client_certificates_) { |
| 436 DoStep(); | 438 DoStep(); |
| 437 return; | 439 return; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 while (!tasks_.empty() && tasks_.front()->IsDone()) | 625 while (!tasks_.empty() && tasks_.front()->IsDone()) |
| 624 tasks_.pop(); | 626 tasks_.pop(); |
| 625 | 627 |
| 626 // Now either the queue is empty or the next task is not finished yet and it | 628 // Now either the queue is empty or the next task is not finished yet and it |
| 627 // can be started. | 629 // can be started. |
| 628 if (!tasks_.empty()) | 630 if (!tasks_.empty()) |
| 629 tasks_.front()->Start(); | 631 tasks_.front()->Start(); |
| 630 } | 632 } |
| 631 | 633 |
| 632 } // namespace chromeos | 634 } // namespace chromeos |
| OLD | NEW |