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

Unified Diff: content/browser/frame_host/navigation_controller_impl.cc

Issue 2305093002: Fix incorrect SSL state being shown for client redirects. (Closed)
Patch Set: fix location.replace for same origin Created 4 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
« no previous file with comments | « chrome/test/data/ssl/redirect.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_controller_impl.cc
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index e49372f1eaa7a76db3cd551e03ea13a037c56f2c..83452ce0619e946335019b84c83e1e9d2bad3bb6 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -1178,6 +1178,7 @@ void NavigationControllerImpl::RendererDidNavigateToExistingPage(
// in https://crbug.com/596707.
NavigationEntryImpl* entry;
+ NavigationHandleImpl* handle = rfh->navigation_handle();
if (params.intended_as_new_entry) {
// This was intended as a new entry but the pending entry was lost in the
// meanwhile and no new page was created. We are stuck at the last committed
@@ -1189,13 +1190,20 @@ void NavigationControllerImpl::RendererDidNavigateToExistingPage(
// Needed for the restore case, where the serialized NavigationEntry doesn't
// have the SSL state.
- NavigationHandleImpl* handle = rfh->navigation_handle();
entry->GetSSL() = handle->ssl_status();
} else {
// This is renderer-initiated. The only kinds of renderer-initated
// navigations that are EXISTING_PAGE are reloads and location.replace,
// which land us at the last committed entry.
entry = GetLastCommittedEntry();
+
+ // Until https://crbug.com/596707 is fixed (see comment at top of method),
+ // we will get here for location.replace for both same origin and different
+ // origin. For the former, there won't be a network request that gives the
+ // SSLStatus so we don't want to change this. For the latter, there will be
+ // a request and so we need to update the SSLStatus.
+ if (params.url.GetOrigin() != entry->GetURL().GetOrigin())
felt 2016/09/06 20:09:55 Oof. This fixes the obvious common case but I am c
jam 2016/09/06 20:20:37 If these events occur (mixed content or malicious
jam 2016/09/06 20:28:54 ok thinking some more about this, one issue which
+ entry->GetSSL() = handle->ssl_status();
}
DCHECK(entry);
« no previous file with comments | « chrome/test/data/ssl/redirect.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698