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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 1978793002: RenderViewImpl::page_id_ isn't initialized for cross-process replacement navigations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nits and remove testing condition. Created 4 years, 7 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/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 75bb31eb4732ef4c141537b0b8d236f3bd05a214..d5a54d8676f277ba277fa7e9fef81d386fcdb4d7 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -3257,8 +3257,18 @@ void RenderFrameImpl::didCommitProvisionalLoad(
internal_data->set_must_reset_scroll_and_scale_state(false);
}
+ const RequestNavigationParams& request_params =
+ navigation_state->request_params();
bool is_new_navigation = commit_type == blink::WebStandardCommit;
- if (is_new_navigation) {
+
+ // Ensure that we allocate a page ID if this is the first navigation for the
+ // page in this process. This can happen even when is_new_navigation
+ // is false, such as after a cross-process location.replace navigation.
+ bool should_init_page_id = render_view_->page_id_ == -1 &&
+ request_params.page_id == -1 &&
+ request_params.nav_entry_id != 0 &&
+ !navigation_state->IsContentInitiated();
+ if (is_new_navigation || should_init_page_id) {
// We bump our Page ID to correspond with the new session history entry.
render_view_->page_id_ = render_view_->next_page_id_++;
@@ -3274,8 +3284,6 @@ void RenderFrameImpl::didCommitProvisionalLoad(
render_view_->history_list_offset_ + 1;
}
} else {
- const RequestNavigationParams& request_params =
- navigation_state->request_params();
if (request_params.nav_entry_id != 0 &&
!request_params.intended_as_new_entry) {
// This is a successful session history navigation!
« no previous file with comments | « content/browser/frame_host/navigation_controller_impl_browsertest.cc ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698