Navigation: Extend NavigationRequest lifetime up to Commit
This CL removes the NavigationHandle ownership transfer at
ReadyToCommit stage. The NavigationRequest will now stay active all the
way up to commit and will hold the NavigationHandle for the entire
duration.
BUG=784904
Change-Id: Idfec6a6d2025c9ab24a7b3013ec5ba10a8fd3870
Reviewed-on: https://chromium-review.googlesource.com/808974
Commit-Queue: Arthur Hemery <[email protected]>
Reviewed-by: Camille Lamy <[email protected]>
Cr-Commit-Position: refs/heads/master@{#530853}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 3484edd..f66501c 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -52,6 +52,7 @@
#include "content/browser/frame_host/interstitial_page_impl.h"
#include "content/browser/frame_host/navigation_entry_impl.h"
#include "content/browser/frame_host/navigation_handle_impl.h"
+#include "content/browser/frame_host/navigation_request.h"
#include "content/browser/frame_host/navigator_impl.h"
#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/frame_host/render_frame_proxy_host.h"
@@ -645,18 +646,15 @@
RenderFrameHostManager* root = GetRenderManager();
root->current_frame_host()->SetRenderFrameCreated(false);
- root->current_frame_host()->SetNavigationHandle(
- std::unique_ptr<NavigationHandleImpl>());
+ root->current_frame_host()->SetNavigationRequest(
+ std::unique_ptr<NavigationRequest>());
- // PlzNavigate: clear up state specific to browser-side navigation.
- if (IsBrowserSideNavigationEnabled()) {
- // Do not update state as the WebContents is being destroyed.
- frame_tree_.root()->ResetNavigationRequest(true, true);
- if (root->speculative_frame_host()) {
- root->speculative_frame_host()->SetRenderFrameCreated(false);
- root->speculative_frame_host()->SetNavigationHandle(
- std::unique_ptr<NavigationHandleImpl>());
- }
+ // Do not update state as the WebContents is being destroyed.
+ frame_tree_.root()->ResetNavigationRequest(true, true);
+ if (root->speculative_frame_host()) {
+ root->speculative_frame_host()->SetRenderFrameCreated(false);
+ root->speculative_frame_host()->SetNavigationRequest(
+ std::unique_ptr<NavigationRequest>());
}
#if BUILDFLAG(ENABLE_PLUGINS)