| 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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 } | 369 } |
| 370 } | 370 } |
| 371 } | 371 } |
| 372 | 372 |
| 373 const base::TimeTicks start_time_; | 373 const base::TimeTicks start_time_; |
| 374 std::vector<CertVerifierRequest*> requests_; | 374 std::vector<CertVerifierRequest*> requests_; |
| 375 CertVerifierWorker* worker_; | 375 CertVerifierWorker* worker_; |
| 376 const BoundNetLog net_log_; | 376 const BoundNetLog net_log_; |
| 377 }; | 377 }; |
| 378 | 378 |
| 379 MultiThreadedCertVerifier::MultiThreadedCertVerifier() | 379 MultiThreadedCertVerifier::MultiThreadedCertVerifier( |
| 380 CertVerifyProc* verify_proc) |
| 380 : cache_(kMaxCacheEntries), | 381 : cache_(kMaxCacheEntries), |
| 381 requests_(0), | 382 requests_(0), |
| 382 cache_hits_(0), | 383 cache_hits_(0), |
| 383 inflight_joins_(0), | 384 inflight_joins_(0), |
| 384 verify_proc_(CertVerifyProc::CreateDefault()) { | 385 verify_proc_(verify_proc) { |
| 385 CertDatabase::GetInstance()->AddObserver(this); | 386 CertDatabase::GetInstance()->AddObserver(this); |
| 386 } | 387 } |
| 387 | 388 |
| 388 MultiThreadedCertVerifier::~MultiThreadedCertVerifier() { | 389 MultiThreadedCertVerifier::~MultiThreadedCertVerifier() { |
| 389 STLDeleteValues(&inflight_); | 390 STLDeleteValues(&inflight_); |
| 390 CertDatabase::GetInstance()->RemoveObserver(this); | 391 CertDatabase::GetInstance()->RemoveObserver(this); |
| 391 } | 392 } |
| 392 | 393 |
| 393 int MultiThreadedCertVerifier::Verify(X509Certificate* cert, | 394 int MultiThreadedCertVerifier::Verify(X509Certificate* cert, |
| 394 const std::string& hostname, | 395 const std::string& hostname, |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 delete job; | 504 delete job; |
| 504 } | 505 } |
| 505 | 506 |
| 506 void MultiThreadedCertVerifier::OnCertTrustChanged( | 507 void MultiThreadedCertVerifier::OnCertTrustChanged( |
| 507 const X509Certificate* cert) { | 508 const X509Certificate* cert) { |
| 508 DCHECK(CalledOnValidThread()); | 509 DCHECK(CalledOnValidThread()); |
| 509 | 510 |
| 510 ClearCache(); | 511 ClearCache(); |
| 511 } | 512 } |
| 512 | 513 |
| 513 void MultiThreadedCertVerifier::SetCertVerifyProc(CertVerifyProc* verify_proc) { | |
| 514 verify_proc_ = verify_proc; | |
| 515 } | |
| 516 | |
| 517 } // namespace net | 514 } // namespace net |
| OLD | NEW |