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 "net/base/multi_threaded_cert_verifier.h" | 5 #include "net/base/multi_threaded_cert_verifier.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 *out_req = request; | 453 *out_req = request; |
454 return ERR_IO_PENDING; | 454 return ERR_IO_PENDING; |
455 } | 455 } |
456 | 456 |
457 void MultiThreadedCertVerifier::CancelRequest(RequestHandle req) { | 457 void MultiThreadedCertVerifier::CancelRequest(RequestHandle req) { |
458 DCHECK(CalledOnValidThread()); | 458 DCHECK(CalledOnValidThread()); |
459 CertVerifierRequest* request = reinterpret_cast<CertVerifierRequest*>(req); | 459 CertVerifierRequest* request = reinterpret_cast<CertVerifierRequest*>(req); |
460 request->Cancel(); | 460 request->Cancel(); |
461 } | 461 } |
462 | 462 |
| 463 MultiThreadedCertVerifier::RequestParams::RequestParams( |
| 464 const SHA1Fingerprint& cert_fingerprint_arg, |
| 465 const SHA1Fingerprint& ca_fingerprint_arg, |
| 466 const std::string& hostname_arg, |
| 467 int flags_arg) |
| 468 : cert_fingerprint(cert_fingerprint_arg), |
| 469 ca_fingerprint(ca_fingerprint_arg), |
| 470 hostname(hostname_arg), |
| 471 flags(flags_arg) {} |
| 472 |
463 // HandleResult is called by CertVerifierWorker on the origin message loop. | 473 // HandleResult is called by CertVerifierWorker on the origin message loop. |
464 // It deletes CertVerifierJob. | 474 // It deletes CertVerifierJob. |
465 void MultiThreadedCertVerifier::HandleResult( | 475 void MultiThreadedCertVerifier::HandleResult( |
466 X509Certificate* cert, | 476 X509Certificate* cert, |
467 const std::string& hostname, | 477 const std::string& hostname, |
468 int flags, | 478 int flags, |
469 int error, | 479 int error, |
470 const CertVerifyResult& verify_result) { | 480 const CertVerifyResult& verify_result) { |
471 DCHECK(CalledOnValidThread()); | 481 DCHECK(CalledOnValidThread()); |
472 | 482 |
(...skipping 26 matching lines...) Expand all Loading... |
499 DCHECK(CalledOnValidThread()); | 509 DCHECK(CalledOnValidThread()); |
500 | 510 |
501 ClearCache(); | 511 ClearCache(); |
502 } | 512 } |
503 | 513 |
504 void MultiThreadedCertVerifier::SetCertVerifyProc(CertVerifyProc* verify_proc) { | 514 void MultiThreadedCertVerifier::SetCertVerifyProc(CertVerifyProc* verify_proc) { |
505 verify_proc_ = verify_proc; | 515 verify_proc_ = verify_proc; |
506 } | 516 } |
507 | 517 |
508 } // namespace net | 518 } // namespace net |
OLD | NEW |