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

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

Issue 1244863003: Attach a SecurityStyle to each request in ResourceLoader (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update forgotten SerializeSecurityInfo() callsite Created 5 years, 5 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_manager.cc
diff --git a/content/browser/ssl/ssl_manager.cc b/content/browser/ssl/ssl_manager.cc
index ab1048c31404dc35e1eb261f1aab427c8d76f10e..48e3aa1b559aec7341194ac034d252c62ed05bd5 100644
--- a/content/browser/ssl/ssl_manager.cc
+++ b/content/browser/ssl/ssl_manager.cc
@@ -121,7 +121,8 @@ void SSLManager::DidCommitProvisionalLoad(const LoadCommittedDetails& details) {
}
}
- UpdateEntry(entry);
+ if (!UpdateEntry(entry))
estark 2015/07/21 22:25:16 If you're wondering why this change is necessary..
davidben 2015/07/22 20:56:57 This probably wants a comment. It took me a while
estark 2015/07/22 22:56:55 Done. (Changed it to call policy()->UpdateEntry()
+ NotifyDidChangeVisibleSSLState();
}
void SSLManager::DidDisplayInsecureContent() {
@@ -176,20 +177,27 @@ void SSLManager::DidReceiveResourceRedirect(
// HTTP request to https://attacker.com/payload.js.
}
-void SSLManager::UpdateEntry(NavigationEntryImpl* entry) {
+bool SSLManager::UpdateEntry(NavigationEntryImpl* entry) {
// We don't always have a navigation entry to update, for example in the
// case of the Web Inspector.
if (!entry)
- return;
+ return false;
SSLStatus original_ssl_status = entry->GetSSL(); // Copy!
+ policy()->UpdateEntry(entry, controller_->delegate()->GetWebContents());
+
+ if (entry->GetSSL().Equals(original_ssl_status))
+ return false;
+
+ NotifyDidChangeVisibleSSLState();
+ return true;
+}
+
+void SSLManager::NotifyDidChangeVisibleSSLState() {
WebContentsImpl* contents =
static_cast<WebContentsImpl*>(controller_->delegate()->GetWebContents());
- policy()->UpdateEntry(entry, contents);
-
- if (!entry->GetSSL().Equals(original_ssl_status))
- contents->DidChangeVisibleSSLState();
+ contents->DidChangeVisibleSSLState();
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698