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

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

Issue 2226523002: Add separate plumbing for subresources with certificate errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo Created 4 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
« no previous file with comments | « content/browser/ssl/ssl_policy.h ('k') | content/browser/ssl/ssl_policy_backend.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/ssl/ssl_policy.cc
diff --git a/content/browser/ssl/ssl_policy.cc b/content/browser/ssl/ssl_policy.cc
index a45e135d16c87e446221d4b35343abb796b75d01..b493a8d74abe3dc7d48fc1492643725f05c2c142 100644
--- a/content/browser/ssl/ssl_policy.cc
+++ b/content/browser/ssl/ssl_policy.cc
@@ -117,6 +117,20 @@ void SSLPolicy::DidRunInsecureContent(NavigationEntryImpl* entry,
site_instance->GetProcess()->GetID());
}
+void SSLPolicy::DidRunContentWithCertificateErrors(
+ NavigationEntryImpl* entry,
+ const GURL& security_origin) {
+ if (!entry)
+ return;
+
+ SiteInstance* site_instance = entry->site_instance();
+ if (!site_instance)
+ return;
+
+ backend_->HostRanContentWithCertificateErrors(
+ security_origin.host(), site_instance->GetProcess()->GetID());
+}
+
void SSLPolicy::OnRequestStarted(const GURL& url,
int cert_id,
net::CertStatus cert_status) {
@@ -156,6 +170,14 @@ void SSLPolicy::UpdateEntry(NavigationEntryImpl* entry,
if (web_contents->DisplayedInsecureContent())
entry->GetSSL().content_status |= SSLStatus::DISPLAYED_INSECURE_CONTENT;
+ if (!web_contents->DisplayedContentWithCertificateErrors())
+ entry->GetSSL().content_status &=
+ ~SSLStatus::DISPLAYED_CONTENT_WITH_CERTIFICATE_ERRORS;
+
+ if (web_contents->DisplayedContentWithCertificateErrors())
+ entry->GetSSL().content_status |=
+ SSLStatus::DISPLAYED_CONTENT_WITH_CERTIFICATE_ERRORS;
+
if (entry->GetSSL().security_style == SECURITY_STYLE_AUTHENTICATION_BROKEN)
return;
@@ -163,12 +185,21 @@ void SSLPolicy::UpdateEntry(NavigationEntryImpl* entry,
// Note that |site_instance| can be NULL here because NavigationEntries don't
// necessarily have site instances. Without a process, the entry can't
// possibly have insecure content. See bug http://crbug.com/12423.
- if (site_instance &&
- backend_->DidHostRunInsecureContent(
+ if (!site_instance)
+ return;
+
+ if (backend_->DidHostRunInsecureContent(
entry->GetURL().host(), site_instance->GetProcess()->GetID())) {
entry->GetSSL().security_style =
SECURITY_STYLE_AUTHENTICATION_BROKEN;
entry->GetSSL().content_status |= SSLStatus::RAN_INSECURE_CONTENT;
+ }
+
+ if (backend_->DidHostRunContentWithCertificateErrors(
+ entry->GetURL().host(), site_instance->GetProcess()->GetID())) {
+ entry->GetSSL().security_style = SECURITY_STYLE_AUTHENTICATION_BROKEN;
+ entry->GetSSL().content_status |=
+ SSLStatus::RAN_CONTENT_WITH_CERTIFICATE_ERRORS;
return;
}
}
« no previous file with comments | « content/browser/ssl/ssl_policy.h ('k') | content/browser/ssl/ssl_policy_backend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698