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

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

Issue 1415923015: Downgrade lock icon for broken-HTTPS subresources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unnecessary includes Created 5 years, 1 month 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_manager.cc
diff --git a/content/browser/ssl/ssl_manager.cc b/content/browser/ssl/ssl_manager.cc
index e4c71e3dc4e0f8b2c520afe4cb9d9979d51140d9..6f08c4c80f4344eefc4008d595b81c9808887804 100644
--- a/content/browser/ssl/ssl_manager.cc
+++ b/content/browser/ssl/ssl_manager.cc
@@ -127,16 +127,34 @@ void SSLManager::DidCommitProvisionalLoad(const LoadCommittedDetails& details) {
NotifyDidChangeVisibleSSLState();
}
-void SSLManager::DidDisplayInsecureContent() {
- UpdateEntry(controller_->GetLastCommittedEntry());
-}
-
void SSLManager::DidRunInsecureContent(const std::string& security_origin) {
NavigationEntryImpl* navigation_entry = controller_->GetLastCommittedEntry();
policy()->DidRunInsecureContent(navigation_entry, security_origin);
UpdateEntry(navigation_entry);
}
+bool SSLManager::IsContentWithCertificateErrorsRelevant(const GURL& url,
+ const SSLStatus& ssl) {
+ // Do not handle subresource certificate errors if the main page is
+ // not loaded over HTTPS.
+ NavigationEntryImpl* entry = controller_->GetLastCommittedEntry();
+ if (!entry || !entry->GetSSL().cert_id)
jww 2015/11/20 01:25:08 We talked about this a while back, and I forget al
estark 2015/11/23 23:40:24 So I ended up moving this to the renderer and chan
jww 2015/11/25 19:24:02 It doesn't seem like there's any increased securit
+ return false;
+
+ // Do not handle subresource certificate errors if they are the same
+ // as errors that occured during the main page load. This compares
+ // most, but not all, fields of SSLStatus. For example, this check
+ // does not compare |content_status| because the navigation entry
+ // might have mixed content but also have the exact same SSL
+ // connection properties as the subresource, thereby making the
+ // subresource errors duplicative.
jww 2015/11/20 01:25:08 Why is security_style not covered by this? Because
estark 2015/11/23 23:40:24 I think just an omission on my part. (The followin
+ return (!url::Origin(entry->GetURL()).IsSameOriginWith(url::Origin(url)) ||
+ entry->GetSSL().cert_id != ssl.cert_id ||
+ entry->GetSSL().cert_status != ssl.cert_status ||
+ entry->GetSSL().security_bits != ssl.security_bits ||
+ entry->GetSSL().connection_status != ssl.connection_status);
+}
+
void SSLManager::DidLoadFromMemoryCache(
const LoadFromMemoryCacheDetails& details) {
// Simulate loading this resource through the usual path.

Powered by Google App Engine
This is Rietveld 408576698