Commit 7170973e authored by Bence Béky's avatar Bence Béky Committed by Commit Bot

Expect |callback| to be non-null in PolicyCertVerifier.

According to
https://cs.chromium.org/chromium/src/net/cert/cert_verifier.h?l=143,
CertVerifier::Verify() must not be called with a null |callback|.
This CL modifies expectation and comment accordingly in PolicyCertVerifier.

This CL is a follow-up to the reviewer's comment at
https://crrev.com/c/1117917/6/chrome/browser/chromeos/policy/policy_cert_verifier.h#47.

Change-Id: If45d08a35c2d2add9e7e111b7cb69810c07788fe
Reviewed-on: https://chromium-review.googlesource.com/1127920Reviewed-by: default avatarMaksim Ivanov <emaxx@chromium.org>
Commit-Queue: Bence Béky <bnc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573836}
parent f3afd05a
...@@ -36,7 +36,6 @@ void CompleteAndSignalAnchorUse(const base::Closure& anchor_used_callback, ...@@ -36,7 +36,6 @@ void CompleteAndSignalAnchorUse(const base::Closure& anchor_used_callback,
int error) { int error) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO); DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
MaybeSignalAnchorUse(error, anchor_used_callback, *verify_result); MaybeSignalAnchorUse(error, anchor_used_callback, *verify_result);
if (completion_callback)
std::move(completion_callback).Run(error); std::move(completion_callback).Run(error);
} }
...@@ -77,6 +76,7 @@ int PolicyCertVerifier::Verify(const RequestParams& params, ...@@ -77,6 +76,7 @@ int PolicyCertVerifier::Verify(const RequestParams& params,
const net::NetLogWithSource& net_log) { const net::NetLogWithSource& net_log) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO); DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
DCHECK(delegate_); DCHECK(delegate_);
DCHECK(completion_callback);
net::CompletionOnceCallback wrapped_callback = net::CompletionOnceCallback wrapped_callback =
base::BindOnce(&CompleteAndSignalAnchorUse, anchor_used_callback_, base::BindOnce(&CompleteAndSignalAnchorUse, anchor_used_callback_,
std::move(completion_callback), verify_result); std::move(completion_callback), verify_result);
......
...@@ -44,7 +44,6 @@ class PolicyCertVerifier : public net::CertVerifier { ...@@ -44,7 +44,6 @@ class PolicyCertVerifier : public net::CertVerifier {
void SetTrustAnchors(const net::CertificateList& trust_anchors); void SetTrustAnchors(const net::CertificateList& trust_anchors);
// CertVerifier: // CertVerifier:
// Note: |callback| can be null.
int Verify(const RequestParams& params, int Verify(const RequestParams& params,
net::CRLSet* crl_set, net::CRLSet* crl_set,
net::CertVerifyResult* verify_result, net::CertVerifyResult* verify_result,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment