| 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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 : cache_(kMaxCacheEntries), | 380 : cache_(kMaxCacheEntries), |
| 381 requests_(0), | 381 requests_(0), |
| 382 cache_hits_(0), | 382 cache_hits_(0), |
| 383 inflight_joins_(0), | 383 inflight_joins_(0), |
| 384 verify_proc_(CertVerifyProc::CreateDefault()) { | 384 verify_proc_(CertVerifyProc::CreateDefault()) { |
| 385 CertDatabase::AddObserver(this); | 385 CertDatabase cert_db; |
| 386 cert_db.AddObserver(this); |
| 386 } | 387 } |
| 387 | 388 |
| 388 MultiThreadedCertVerifier::~MultiThreadedCertVerifier() { | 389 MultiThreadedCertVerifier::~MultiThreadedCertVerifier() { |
| 389 STLDeleteValues(&inflight_); | 390 STLDeleteValues(&inflight_); |
| 390 | 391 |
| 391 CertDatabase::RemoveObserver(this); | 392 CertDatabase cert_db; |
| 393 cert_db.RemoveObserver(this); |
| 392 } | 394 } |
| 393 | 395 |
| 394 int MultiThreadedCertVerifier::Verify(X509Certificate* cert, | 396 int MultiThreadedCertVerifier::Verify(X509Certificate* cert, |
| 395 const std::string& hostname, | 397 const std::string& hostname, |
| 396 int flags, | 398 int flags, |
| 397 CRLSet* crl_set, | 399 CRLSet* crl_set, |
| 398 CertVerifyResult* verify_result, | 400 CertVerifyResult* verify_result, |
| 399 const CompletionCallback& callback, | 401 const CompletionCallback& callback, |
| 400 RequestHandle* out_req, | 402 RequestHandle* out_req, |
| 401 const BoundNetLog& net_log) { | 403 const BoundNetLog& net_log) { |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 DCHECK(CalledOnValidThread()); | 511 DCHECK(CalledOnValidThread()); |
| 510 | 512 |
| 511 ClearCache(); | 513 ClearCache(); |
| 512 } | 514 } |
| 513 | 515 |
| 514 void MultiThreadedCertVerifier::SetCertVerifyProc(CertVerifyProc* verify_proc) { | 516 void MultiThreadedCertVerifier::SetCertVerifyProc(CertVerifyProc* verify_proc) { |
| 515 verify_proc_ = verify_proc; | 517 verify_proc_ = verify_proc; |
| 516 } | 518 } |
| 517 | 519 |
| 518 } // namespace net | 520 } // namespace net |
| OLD | NEW |