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

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

Issue 2410023003: Add unit test for notifying WebContents when SSLStatus changes due to HTTP-bad (Closed)
Patch Set: nasko comment Created 4 years, 2 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 | « no previous file | content/browser/ssl/ssl_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/ssl/ssl_manager.cc
diff --git a/content/browser/ssl/ssl_manager.cc b/content/browser/ssl/ssl_manager.cc
index 4ba9ab13365944a7a5b63eb1cb384dd8a0b53ebf..4ed44b46f1f9645c78cee081c6e24c4ef6196699 100644
--- a/content/browser/ssl/ssl_manager.cc
+++ b/content/browser/ssl/ssl_manager.cc
@@ -371,22 +371,23 @@ void SSLManager::UpdateEntry(NavigationEntryImpl* entry,
SiteInstance* site_instance = entry->site_instance();
// 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 && ssl_host_state_delegate_ &&
- ssl_host_state_delegate_->DidHostRunInsecureContent(
- entry->GetURL().host(), site_instance->GetProcess()->GetID(),
- SSLHostStateDelegate::MIXED_CONTENT)) {
- entry->GetSSL().content_status |= SSLStatus::RAN_INSECURE_CONTENT;
- }
+ // possibly have insecure content. See bug https://crbug.com/12423.
+ if (site_instance && ssl_host_state_delegate_) {
+ std::string host = entry->GetURL().host();
+ int process_id = site_instance->GetProcess()->GetID();
+ if (ssl_host_state_delegate_->DidHostRunInsecureContent(
+ host, process_id, SSLHostStateDelegate::MIXED_CONTENT)) {
+ entry->GetSSL().content_status |= SSLStatus::RAN_INSECURE_CONTENT;
+ }
- // Only record information about subresources with cert errors if the
- // main page is HTTPS with a certificate.
- if (entry->GetURL().SchemeIsCryptographic() && entry->GetSSL().certificate &&
- site_instance && ssl_host_state_delegate_ &&
- ssl_host_state_delegate_->DidHostRunInsecureContent(
- entry->GetURL().host(), site_instance->GetProcess()->GetID(),
- SSLHostStateDelegate::CERT_ERRORS_CONTENT)) {
- entry->GetSSL().content_status |= SSLStatus::RAN_CONTENT_WITH_CERT_ERRORS;
+ // Only record information about subresources with cert errors if the
+ // main page is HTTPS with a certificate.
+ if (entry->GetURL().SchemeIsCryptographic() &&
+ entry->GetSSL().certificate &&
+ ssl_host_state_delegate_->DidHostRunInsecureContent(
+ host, process_id, SSLHostStateDelegate::CERT_ERRORS_CONTENT)) {
+ entry->GetSSL().content_status |= SSLStatus::RAN_CONTENT_WITH_CERT_ERRORS;
+ }
}
if (!entry->GetSSL().Equals(original_ssl_status))
« no previous file with comments | « no previous file | content/browser/ssl/ssl_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698