Chromium Code Reviews| Index: chrome/browser/chromeos/policy/policy_cert_verifier.cc |
| diff --git a/chrome/browser/chromeos/policy/policy_cert_verifier.cc b/chrome/browser/chromeos/policy/policy_cert_verifier.cc |
| index 69d14e2a182411dbddf321c791eb8449b58fa310..f6a564250961bee400f71861bc4349ab8abe31e5 100644 |
| --- a/chrome/browser/chromeos/policy/policy_cert_verifier.cc |
| +++ b/chrome/browser/chromeos/policy/policy_cert_verifier.cc |
| @@ -58,11 +58,8 @@ void PolicyCertVerifier::InitializeOnIOThread( |
| LOG(WARNING) |
| << "Additional trust anchors not supported on the current platform!"; |
| } |
| - std::unique_ptr<net::CachingCertVerifier> verifier = |
| - base::MakeUnique<net::CachingCertVerifier>( |
| - base::MakeUnique<net::MultiThreadedCertVerifier>(verify_proc.get())); |
| - verifier->SetCertTrustAnchorProvider(this); |
| - delegate_ = std::move(verifier); |
| + delegate_ = base::MakeUnique<net::CachingCertVerifier>( |
| + base::MakeUnique<net::MultiThreadedCertVerifier>(verify_proc.get())); |
| } |
| void PolicyCertVerifier::SetTrustAnchors( |
| @@ -85,7 +82,14 @@ int PolicyCertVerifier::Verify( |
| anchor_used_callback_, |
| completion_callback, |
| verify_result); |
| - int error = delegate_->Verify(params, crl_set, verify_result, |
| + |
| + CertificateList merged_trust_anchors(params.additional_trust_anchors()); |
|
eroman
2016/06/16 19:56:38
How about reserving the concatenated length first?
Ryan Sleevi
2016/06/16 21:07:14
.insert() does this prior to the insertion (since
eroman
2016/06/16 21:47:29
Not quite. This does two allocations: first it cop
Ryan Sleevi
2016/06/16 21:50:35
That's what I said.
|
| + merged_trust_anchors.insert(merged_trust_anchors.begin(), |
| + trust_anchors_.begin(), trust_anchors_.end()); |
| + net::CertVerifier::RequestParams new_params( |
| + params.certificate(), params.hostname(), params.flags(), |
| + params.ocsp_response(), merged_trust_anchors); |
| + int error = delegate_->Verify(new_params, crl_set, verify_result, |
| wrapped_callback, out_req, net_log); |
| MaybeSignalAnchorUse(error, anchor_used_callback_, *verify_result); |
| return error; |
| @@ -96,9 +100,4 @@ bool PolicyCertVerifier::SupportsOCSPStapling() { |
| return delegate_->SupportsOCSPStapling(); |
| } |
| -const net::CertificateList& PolicyCertVerifier::GetAdditionalTrustAnchors() { |
| - DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| - return trust_anchors_; |
| -} |
| - |
| } // namespace policy |