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

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

Issue 2305093002: Fix incorrect SSL state being shown for client redirects. (Closed)
Patch Set: more tests 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 | « content/browser/frame_host/navigation_controller_impl.h ('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..da3494b37c20e406ae12e05d2c6267cde01a5c38 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -825,7 +825,7 @@ bool NavigationControllerImpl::RendererDidNavigate(
break;
case NAVIGATION_TYPE_EXISTING_PAGE:
details->did_replace_entry = details->is_in_page;
- RendererDidNavigateToExistingPage(rfh, params);
+ RendererDidNavigateToExistingPage(rfh, params, details->is_in_page);
break;
case NAVIGATION_TYPE_SAME_PAGE:
RendererDidNavigateToSamePage(rfh, params);
@@ -1170,7 +1170,8 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
void NavigationControllerImpl::RendererDidNavigateToExistingPage(
RenderFrameHostImpl* rfh,
- const FrameHostMsg_DidCommitProvisionalLoad_Params& params) {
+ const FrameHostMsg_DidCommitProvisionalLoad_Params& params,
+ bool is_in_page) {
// We should only get here for main frame navigations.
DCHECK(!rfh->GetParent());
@@ -1178,6 +1179,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 +1191,17 @@ 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();
+
+ // If this is an in-page navigation, then there's no SSLStatus in the
+ // NavigationHandle so don't overwrite the existing entry's SSLStatus.
+ if (!is_in_page)
+ entry->GetSSL() = handle->ssl_status();
}
DCHECK(entry);
« no previous file with comments | « content/browser/frame_host/navigation_controller_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698