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/cert/multi_threaded_cert_verifier.h" | 5 #include "net/cert/multi_threaded_cert_verifier.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 const BoundNetLog& net_log) { | 420 const BoundNetLog& net_log) { |
421 out_req->reset(); | 421 out_req->reset(); |
422 | 422 |
423 DCHECK(CalledOnValidThread()); | 423 DCHECK(CalledOnValidThread()); |
424 | 424 |
425 if (callback.is_null() || !verify_result || hostname.empty()) | 425 if (callback.is_null() || !verify_result || hostname.empty()) |
426 return ERR_INVALID_ARGUMENT; | 426 return ERR_INVALID_ARGUMENT; |
427 | 427 |
428 requests_++; | 428 requests_++; |
429 | 429 |
430 const CertificateList empty_cert_list; | 430 const CertificateList empty_cert_list = CertificateList(); |
431 const CertificateList& additional_trust_anchors = | 431 const CertificateList& additional_trust_anchors = |
432 trust_anchor_provider_ ? | 432 trust_anchor_provider_ ? |
433 trust_anchor_provider_->GetAdditionalTrustAnchors() : empty_cert_list; | 433 trust_anchor_provider_->GetAdditionalTrustAnchors() : empty_cert_list; |
434 | 434 |
435 const RequestParams key(cert->fingerprint(), cert->ca_fingerprint(), hostname, | 435 const RequestParams key(cert->fingerprint(), cert->ca_fingerprint(), hostname, |
436 ocsp_response, flags, additional_trust_anchors); | 436 ocsp_response, flags, additional_trust_anchors); |
437 const CertVerifierCache::value_type* cached_entry = | 437 const CertVerifierCache::value_type* cached_entry = |
438 cache_.Get(key, CacheValidityPeriod(base::Time::Now())); | 438 cache_.Get(key, CacheValidityPeriod(base::Time::Now())); |
439 if (cached_entry) { | 439 if (cached_entry) { |
440 ++cache_hits_; | 440 ++cache_hits_; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 // search. | 582 // search. |
583 auto it = std::lower_bound(inflight_.begin(), inflight_.end(), key, | 583 auto it = std::lower_bound(inflight_.begin(), inflight_.end(), key, |
584 JobToRequestParamsComparator()); | 584 JobToRequestParamsComparator()); |
585 if (it != inflight_.end() && !(key < (*it)->key())) | 585 if (it != inflight_.end() && !(key < (*it)->key())) |
586 return *it; | 586 return *it; |
587 return nullptr; | 587 return nullptr; |
588 } | 588 } |
589 | 589 |
590 } // namespace net | 590 } // namespace net |
591 | 591 |
OLD | NEW |