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

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

Issue 2239273002: Don't use SSLStatus from FrameHostMsg_DidCommitProvisionalLoad and instead cache it on the browser … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: slight cleanup Created 4 years, 4 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/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 ffcd8eedd6ae59f0b8e228a1ed701b16c9ab9e2f..ecee3ff57ab4d532e54ac2419be2f73e65e05841 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -1127,7 +1127,20 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
// type must always be normal or error.
new_entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR
: PAGE_TYPE_NORMAL);
- new_entry->SetURL(params.url);
+ if (params.url != new_entry->GetURL()) {
estark 2016/08/15 08:14:08 Is this check just an optimization? I'm concerned
jam 2016/08/15 19:23:58 It wasn't; looking at it again it was poorly writt
mmenke 2016/08/15 22:48:31 It could be two different servers with the same ho
+ new_entry->SetURL(params.url);
+ // New URL means that we can't use the old SSLStatus.
+ new_entry->GetSSL() = SSLStatus();
+ }
+
+ if (rfh->frame_tree_node()->IsMainFrame()) {
+ // In case of redirects (same process or across different ones), the
+ // SSLStatus was cached on the pending RFH so use it now.
+ SSLStatus ssl_status;
+ if (rfh->GetSSLStatusForPendingNavigate(params.url, &ssl_status))
estark 2016/08/15 08:14:08 Just checking -- we're guaranteed that the returne
jam 2016/08/15 19:23:58 I don't think this is guaranteed. i.e. in the Site
+ new_entry->GetSSL() = ssl_status;
+ }
+
if (update_virtual_url)
UpdateVirtualURLToURL(new_entry.get(), params.url);
new_entry->SetReferrer(params.referrer);
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_impl.h » ('j') | content/browser/loader/resource_loader.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698