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

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

Issue 2299843002: Fix the page's SSL status not being set on restore. (Closed)
Patch Set: add same page fix and test 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/browser/ssl/ssl_browser_tests.cc ('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 55c5fa41d72e6f1f435093482dd176da73f556a6..fcfbc8d33c77444d27ad7d3e6005bd2a40e826fe 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -1186,6 +1186,11 @@ void NavigationControllerImpl::RendererDidNavigateToExistingPage(
} else if (params.nav_entry_id) {
// This is a browser-initiated navigation (back/forward/reload).
entry = GetEntryWithUniqueID(params.nav_entry_id);
+
+ // 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,
@@ -1260,6 +1265,11 @@ void NavigationControllerImpl::RendererDidNavigateToSamePage(
UpdateVirtualURLToURL(existing_entry, params.url);
existing_entry->SetURL(params.url);
+ // If a user presses enter in the omnibox and the server redirects, the URL
+ // might change (but it's still considered a SAME_PAGE navigation). So we must
+ // update the SSL status.
+ existing_entry->GetSSL() = rfh->navigation_handle()->ssl_status();
nasko 2016/09/01 15:48:45 Just out of curiousity, does the new test you adde
jam 2016/09/01 15:53:01 of course :)
+
// Update the existing FrameNavigationEntry to ensure all of its members
// reflect the parameters coming from the renderer process.
existing_entry->AddOrUpdateFrameEntry(
« no previous file with comments | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698