| Index: content/browser/frame_host/render_frame_host_manager.cc
|
| diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
|
| index e62701a118b77c89d5b9e6309c1fbada3d6e456c..95e2f8c0c711700c2ccd9d5259defe2ca9114e26 100644
|
| --- a/content/browser/frame_host/render_frame_host_manager.cc
|
| +++ b/content/browser/frame_host/render_frame_host_manager.cc
|
| @@ -18,7 +18,6 @@
|
| #include "base/trace_event/trace_event.h"
|
| #include "content/browser/child_process_security_policy_impl.h"
|
| #include "content/browser/devtools/render_frame_devtools_agent_host.h"
|
| -#include "content/browser/frame_host/cross_site_transferring_request.h"
|
| #include "content/browser/frame_host/debug_urls.h"
|
| #include "content/browser/frame_host/frame_navigation_entry.h"
|
| #include "content/browser/frame_host/interstitial_page_impl.h"
|
| @@ -281,26 +280,18 @@ RenderFrameHostImpl* RenderFrameHostManager::Navigate(
|
|
|
| // If entry includes the request ID of a request that is being transferred,
|
| // the destination render frame will take ownership, so release ownership of
|
| - // the request.
|
| - if (cross_site_transferring_request_.get() &&
|
| - cross_site_transferring_request_->request_id() ==
|
| + // the transferring NavigationHandle.
|
| + if (transfer_navigation_handle_.get() &&
|
| + transfer_navigation_handle_->request_id() ==
|
| entry.transferred_global_request_id()) {
|
| - cross_site_transferring_request_->ReleaseRequest();
|
| -
|
| - DCHECK(transfer_navigation_handle_);
|
| -
|
| - // Update the pending NavigationEntry ID on the transferring handle.
|
| - // TODO(creis): Make this line unnecessary by avoiding having a pending
|
| - // entry for transfer navigations. See https://crbug.com/495161.
|
| - transfer_navigation_handle_->update_entry_id_for_transfer(
|
| - entry.GetUniqueID());
|
| -
|
| // The navigating RenderFrameHost should take ownership of the
|
| // NavigationHandle that came from the transferring RenderFrameHost.
|
| dest_render_frame_host->SetNavigationHandle(
|
| std::move(transfer_navigation_handle_));
|
| +
|
| + dest_render_frame_host->navigation_handle()->TransferToRenderFrameHost(
|
| + dest_render_frame_host);
|
| }
|
| - DCHECK(!transfer_navigation_handle_);
|
|
|
| return dest_render_frame_host;
|
| }
|
| @@ -422,17 +413,10 @@ void RenderFrameHostManager::OnBeforeUnloadACK(
|
| void RenderFrameHostManager::OnCrossSiteResponse(
|
| RenderFrameHostImpl* transferring_render_frame_host,
|
| const GlobalRequestID& global_request_id,
|
| - std::unique_ptr<CrossSiteTransferringRequest>
|
| - cross_site_transferring_request,
|
| const std::vector<GURL>& transfer_url_chain,
|
| const Referrer& referrer,
|
| ui::PageTransition page_transition,
|
| bool should_replace_current_entry) {
|
| - // We should only get here for transfer navigations. Most cross-process
|
| - // navigations can just continue and wait to run the unload handler (by
|
| - // swapping out) when the new navigation commits.
|
| - CHECK(cross_site_transferring_request);
|
| -
|
| // A transfer should only have come from our pending or current RFH. If it
|
| // started as a cross-process navigation via OpenURL, this is the pending
|
| // one. If it wasn't cross-process until the transfer, this is the current
|
| @@ -459,16 +443,7 @@ void RenderFrameHostManager::OnCrossSiteResponse(
|
| // after it started navigating.
|
| transfer_navigation_handle_ =
|
| transferring_render_frame_host->PassNavigationHandleOwnership();
|
| -
|
| - // If something caused the cancellation of this navigation on the UI thread
|
| - // (possibly for security reasons) the navigation should not be allowed to
|
| - // proceed.
|
| - if (!transfer_navigation_handle_)
|
| - return;
|
| -
|
| - // Store the transferring request so that we can release it if the transfer
|
| - // navigation matches.
|
| - cross_site_transferring_request_ = std::move(cross_site_transferring_request);
|
| + CHECK(transfer_navigation_handle_);
|
|
|
| // Set the transferring RenderFrameHost as not loading, so that it does not
|
| // emit a DidStopLoading notification if it is destroyed when creating the
|
| @@ -491,12 +466,10 @@ void RenderFrameHostManager::OnCrossSiteResponse(
|
| transfer_navigation_handle_->IsPost() ? "POST" : "GET",
|
| transfer_navigation_handle_->resource_request_body());
|
|
|
| - // The transferring request was only needed during the RequestTransferURL
|
| - // call, so it is safe to clear at this point.
|
| - cross_site_transferring_request_.reset();
|
| -
|
| // If the navigation continued, the NavigationHandle should have been
|
| // transfered to a RenderFrameHost. In the other cases, it should be cleared.
|
| + // If the NavigationHandle wasn't claimed, this will lead to the cancelation
|
| + // of the request in the network stack.
|
| transfer_navigation_handle_.reset();
|
|
|
| // If the navigation in the new renderer did not start, inform the
|
| @@ -2298,8 +2271,9 @@ RenderFrameHostImpl* RenderFrameHostManager::UpdateStateForNavigate(
|
| if (is_transfer) {
|
| // We don't need to stop the old renderer or run beforeunload/unload
|
| // handlers, because those have already been done.
|
| - DCHECK(cross_site_transferring_request_->request_id() ==
|
| - transferred_request_id);
|
| + DCHECK(transfer_navigation_handle_ &&
|
| + transfer_navigation_handle_->request_id() ==
|
| + transferred_request_id);
|
| } else if (!pending_render_frame_host_->are_navigations_suspended()) {
|
| // If the pending RFH hasn't already been suspended from a previous
|
| // attempt to navigate it, then we need to wait for the beforeunload
|
|
|