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

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

Issue 441043005: Cleanup of SSLHostStateDelegate and related code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: const and pass-by-ref changes Created 6 years, 3 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.cc
diff --git a/content/browser/ssl/ssl_policy.cc b/content/browser/ssl/ssl_policy.cc
index 18fdde4dfe2bf9823e716ae01e48db73f1641fb8..d5a3a76fa8a0f2b78fcba9f73fd8a5af667f41f1 100644
--- a/content/browser/ssl/ssl_policy.cc
+++ b/content/browser/ssl/ssl_policy.cc
@@ -34,8 +34,9 @@ SSLPolicy::SSLPolicy(SSLPolicyBackend* backend)
void SSLPolicy::OnCertError(SSLCertErrorHandler* handler) {
bool expired_previous_decision;
// First we check if we know the policy for this error.
+ DCHECK(handler->ssl_info().is_valid());
net::CertPolicy::Judgment judgment =
- backend_->QueryPolicy(handler->ssl_info().cert.get(),
+ backend_->QueryPolicy(*handler->ssl_info().cert.get(),
handler->request_url().host(),
handler->cert_error(),
&expired_previous_decision);
@@ -163,6 +164,7 @@ void SSLPolicy::UpdateEntry(NavigationEntryImpl* entry,
void SSLPolicy::OnAllowCertificate(scoped_refptr<SSLCertErrorHandler> handler,
bool allow) {
+ DCHECK(handler->ssl_info().is_valid());
if (allow) {
// Default behavior for accepting a certificate.
// Note that we should not call SetMaxSecurityStyle here, because the active
@@ -174,7 +176,7 @@ void SSLPolicy::OnAllowCertificate(scoped_refptr<SSLCertErrorHandler> handler,
// While AllowCertForHost() executes synchronously on this thread,
// ContinueRequest() gets posted to a different thread. Calling
// AllowCertForHost() first ensures deterministic ordering.
- backend_->AllowCertForHost(handler->ssl_info().cert.get(),
+ backend_->AllowCertForHost(*handler->ssl_info().cert.get(),
handler->request_url().host(),
handler->cert_error());
handler->ContinueRequest();
@@ -184,7 +186,7 @@ void SSLPolicy::OnAllowCertificate(scoped_refptr<SSLCertErrorHandler> handler,
// While DenyCertForHost() executes synchronously on this thread,
// CancelRequest() gets posted to a different thread. Calling
// DenyCertForHost() first ensures deterministic ordering.
- backend_->DenyCertForHost(handler->ssl_info().cert.get(),
+ backend_->DenyCertForHost(*handler->ssl_info().cert.get(),
handler->request_url().host(),
handler->cert_error());
handler->CancelRequest();

Powered by Google App Engine
This is Rietveld 408576698