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

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

Issue 1661423002: Solidify Entry discarding logic (NavigationHandle keeps its ID) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nav id hack for data navs with base url Created 4 years, 10 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/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 44998359d6471848be4aeaa8caee6821506af5d2..a3eaf305992cd389d33877a91c6873fcb531a46e 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1002,8 +1002,15 @@ void RenderFrameHostImpl::OnDidCommitProvisionalLoad(const IPC::Message& msg) {
// commit as a new navigation. This can happen if an ongoing slow
// same-process navigation is interrupted by a synchronous renderer-initiated
// navigation.
+ // TODO(csharrison): Data navigations with base URLs get reset here, because
+ // the NavigationHandle tracks the base URL but the validated_params.url track
+ // the data. The trick of saving the old entry ids for these navigations
+ // should go away when this is properly handled.
+ int entry_id_for_data_nav = 0;
if (navigation_handle_ &&
- navigation_handle_->GetURL() != validated_params.url) {
+ (navigation_handle_->GetURL() != validated_params.url)) {
+ if (navigation_handle_->GetURL() == validated_params.base_url)
Charlie Reis 2016/02/10 00:25:42 Why even reset the NavHandle in this case? Creati
Charlie Harrison 2016/02/11 20:23:05 It is wrong, but I think we have to do a more fund
+ entry_id_for_data_nav = navigation_handle_->pending_nav_entry_id();
navigation_handle_.reset();
}
@@ -1011,8 +1018,12 @@ void RenderFrameHostImpl::OnDidCommitProvisionalLoad(const IPC::Message& msg) {
// DidCommitProvisionalLoad IPC without a prior DidStartProvisionalLoad
// message.
if (!navigation_handle_) {
+ // There is no pending NavigationEntry in these cases, so pass 0 as the
+ // nav_id. If the previous handle was a prematurely aborted data nav, then
+ // propagate the entry id.
navigation_handle_ = NavigationHandleImpl::Create(
- validated_params.url, frame_tree_node_, base::TimeTicks::Now());
+ validated_params.url, frame_tree_node_, base::TimeTicks::Now(),
+ entry_id_for_data_nav);
}
accessibility_reset_count_ = 0;

Powered by Google App Engine
This is Rietveld 408576698