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

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

Issue 2475693002: Do not reset NavigationHandle when navigating same-page (Closed)
Patch Set: Rebase + removed DCHECK Created 4 years, 1 month 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/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index 2b5cc426ef60715e1e7cadb37698a4a7359954d6..5740af67acbee9231ed9620e601cc8be1848aa9a 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -511,7 +511,8 @@ bool NavigatorImpl::NavigateNewChildFrame(
void NavigatorImpl::DidNavigate(
RenderFrameHostImpl* render_frame_host,
- const FrameHostMsg_DidCommitProvisionalLoad_Params& params) {
+ const FrameHostMsg_DidCommitProvisionalLoad_Params& params,
+ std::unique_ptr<NavigationHandleImpl> navigation_handle) {
FrameTree* frame_tree = render_frame_host->frame_tree_node()->frame_tree();
bool oopifs_possible = SiteIsolationPolicy::AreCrossProcessFramesPossible();
@@ -618,7 +619,8 @@ void NavigatorImpl::DidNavigate(
int old_entry_count = controller_->GetEntryCount();
LoadCommittedDetails details;
bool did_navigate = controller_->RendererDidNavigate(
- render_frame_host, params, &details, is_navigation_within_page);
+ render_frame_host, params, &details, is_navigation_within_page,
+ navigation_handle.get());
// If the history length and/or offset changed, update other renderers in the
// FrameTree.
@@ -667,9 +669,9 @@ void NavigatorImpl::DidNavigate(
delegate_->DidCommitProvisionalLoad(render_frame_host,
params.url,
transition_type);
- render_frame_host->navigation_handle()->DidCommitNavigation(
- params, is_navigation_within_page, render_frame_host);
- render_frame_host->SetNavigationHandle(nullptr);
+ navigation_handle->DidCommitNavigation(params, is_navigation_within_page,
+ render_frame_host);
+ navigation_handle.reset();
}
if (!did_navigate)
@@ -1070,11 +1072,6 @@ void NavigatorImpl::LogBeforeUnloadTime(
}
}
-NavigationHandleImpl* NavigatorImpl::GetNavigationHandleForFrameHost(
- RenderFrameHostImpl* render_frame_host) {
- return render_frame_host->navigation_handle();
-}
-
void NavigatorImpl::DiscardPendingEntryIfNeeded(NavigationHandleImpl* handle) {
// Racy conditions can cause a fail message to arrive after its corresponding
// pending entry has been replaced by another navigation. If

Powered by Google App Engine
This is Rietveld 408576698