OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/certificate_provider/certificate_provider_serv
ice.h" | 5 #include "chrome/browser/chromeos/certificate_provider/certificate_provider_serv
ice.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 void CertificateProviderService::RequestSignatureFromExtension( | 437 void CertificateProviderService::RequestSignatureFromExtension( |
438 const std::string& extension_id, | 438 const std::string& extension_id, |
439 const scoped_refptr<net::X509Certificate>& certificate, | 439 const scoped_refptr<net::X509Certificate>& certificate, |
440 net::SSLPrivateKey::Hash hash, | 440 net::SSLPrivateKey::Hash hash, |
441 const std::string& digest, | 441 const std::string& digest, |
442 const net::SSLPrivateKey::SignCallback& callback) { | 442 const net::SSLPrivateKey::SignCallback& callback) { |
443 DCHECK(thread_checker_.CalledOnValidThread()); | 443 DCHECK(thread_checker_.CalledOnValidThread()); |
444 | 444 |
445 const int sign_request_id = sign_requests_.AddRequest(extension_id, callback); | 445 const int sign_request_id = sign_requests_.AddRequest(extension_id, callback); |
446 if (!delegate_->DispatchSignRequestToExtension(extension_id, sign_request_id, | 446 if (!delegate_->DispatchSignRequestToExtension(extension_id, sign_request_id, |
447 hash, digest)) { | 447 hash, certificate, digest)) { |
448 sign_requests_.RemoveRequest(extension_id, sign_request_id, | 448 sign_requests_.RemoveRequest(extension_id, sign_request_id, |
449 nullptr /* callback */); | 449 nullptr /* callback */); |
450 callback.Run(net::ERR_FAILED, std::vector<uint8_t>()); | 450 callback.Run(net::ERR_FAILED, std::vector<uint8_t>()); |
451 } | 451 } |
452 } | 452 } |
453 | 453 |
454 } // namespace chromeos | 454 } // namespace chromeos |
OLD | NEW |