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

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

Issue 1777903003: Ensure the NavigationHandle's nav entry ID is updated during transfers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move fix to another CL (now cleanup only) Created 4 years, 9 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 e24b58e84c6d09a62902022699c380921c95f04c..9d002090d3f6e0c043c2ba61dd082a0f458005c9 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -830,6 +830,12 @@ void NavigationControllerImpl::LoadURLWithParams(const LoadURLParams& params) {
LoadEntry(std::move(entry));
}
+bool NavigationControllerImpl::PendingEntryMatchesHandle(
+ NavigationHandleImpl* handle) const {
+ return pending_entry_ &&
+ pending_entry_->GetUniqueID() == handle->pending_nav_entry_id();
+}
+
bool NavigationControllerImpl::RendererDidNavigate(
RenderFrameHostImpl* rfh,
const FrameHostMsg_DidCommitProvisionalLoad_Params& params,
@@ -1109,9 +1115,8 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
// TODO(csharrison): Investigate whether we can remove some of the coarser
// checks.
NavigationHandleImpl* handle = rfh->navigation_handle();
- if (pending_entry_ && handle &&
- handle->pending_nav_entry_id() == pending_entry_->GetUniqueID() &&
- pending_entry_index_ == -1 &&
+ DCHECK(handle);
+ if (PendingEntryMatchesHandle(handle) && pending_entry_index_ == -1 &&
(!pending_entry_->site_instance() ||
pending_entry_->site_instance() == rfh->GetSiteInstance())) {
new_entry = pending_entry_->Clone();

Powered by Google App Engine
This is Rietveld 408576698