Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(614)

Unified Diff: content/browser/ssl/ssl_policy_backend.cc

Issue 465133004: Remove DenyCertForHost from SSLHostStateDelegate API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/ssl/ssl_policy_backend.cc
diff --git a/content/browser/ssl/ssl_policy_backend.cc b/content/browser/ssl/ssl_policy_backend.cc
index e81c35d1628108c46477c5242d8cb61da1ff5efd..b776fd3c417c596934d139f1855a6619435defdb 100644
--- a/content/browser/ssl/ssl_policy_backend.cc
+++ b/content/browser/ssl/ssl_policy_backend.cc
@@ -31,13 +31,6 @@ bool SSLPolicyBackend::DidHostRunInsecureContent(const std::string& host,
return ssl_host_state_delegate_->DidHostRunInsecureContent(host, pid);
}
-void SSLPolicyBackend::DenyCertForHost(net::X509Certificate* cert,
- const std::string& host,
- net::CertStatus error) {
- if (ssl_host_state_delegate_)
- ssl_host_state_delegate_->DenyCert(host, cert, error);
-}
-
void SSLPolicyBackend::AllowCertForHost(net::X509Certificate* cert,
const std::string& host,
net::CertStatus error) {
@@ -53,8 +46,13 @@ net::CertPolicy::Judgment SSLPolicyBackend::QueryPolicy(
if (!ssl_host_state_delegate_)
Peter Kasting 2014/08/22 00:57:53 Nit: This whole function could just be: return
jww 2014/08/22 03:49:35 Done.
return net::CertPolicy::UNKNOWN;
- return ssl_host_state_delegate_->QueryPolicy(
+ net::CertPolicy::Judgment judgement = ssl_host_state_delegate_->QueryPolicy(
host, cert, error, expired_previous_decision);
+ // SSLHostStateDelegate guarantees that it will only return ALLOWED or UNKNOWN
+ // and this method promises the same so check that before returning.
+ DCHECK(judgement == net::CertPolicy::ALLOWED ||
+ judgement == net::CertPolicy::UNKNOWN);
+ return judgement;
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698