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

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

Issue 1545973002: Remove the is_loading_ field from WebContentsImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + addressed Nasko's nits Created 4 years, 10 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
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/browser/site_instance_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cd1684b769a1b7479a79e30536bf586b6eafeec9..766e9689d3059cdc9bf35d47c361174ff0dfdfb1 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -437,6 +437,7 @@ void RenderFrameHostManager::OnCrossSiteResponse(
// should probably cancel the request in that case.
DCHECK(pending_render_frame_host == pending_render_frame_host_.get() ||
pending_render_frame_host == render_frame_host_.get());
+ DCHECK(frame_tree_node_->IsLoading());
// Store the transferring request so that we can release it if the transfer
// navigation matches.
@@ -448,6 +449,11 @@ void RenderFrameHostManager::OnCrossSiteResponse(
pending_render_frame_host->PassNavigationHandleOwnership();
DCHECK(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
+ // new navigating RenderFrameHost.
+ pending_render_frame_host->set_is_loading(false);
+
// Sanity check that the params are for the correct frame and process.
// These should match the RenderFrameHost that made the request.
// If it started as a cross-process navigation via OpenURL, this is the
@@ -480,6 +486,11 @@ void RenderFrameHostManager::OnCrossSiteResponse(
// If the navigation continued, the NavigationHandle should have been
// transfered to a RenderFrameHost. In the other cases, it should be cleared.
transfer_navigation_handle_.reset();
+
+ // If the navigation in the new renderer did not start, inform the
+ // FrameTreeNode that it stopped loading.
+ if (!frame_tree_node_->IsLoading())
+ frame_tree_node_->DidStopLoading();
}
void RenderFrameHostManager::DidNavigateFrame(
@@ -912,8 +923,12 @@ RenderFrameHostImpl* RenderFrameHostManager::GetFrameHostForNavigation(
void RenderFrameHostManager::CleanUpNavigation() {
CHECK(IsBrowserSideNavigationEnabled());
render_frame_host_->ClearPendingWebUI();
- if (speculative_render_frame_host_)
+ if (speculative_render_frame_host_) {
+ bool was_loading = speculative_render_frame_host_->is_loading();
DiscardUnusedFrame(UnsetSpeculativeRenderFrameHost());
+ if (was_loading)
+ frame_tree_node_->DidStopLoading();
+ }
}
// PlzNavigate
@@ -2002,6 +2017,7 @@ void RenderFrameHostManager::CommitPending() {
// now to make sure the sad tab shows up, etc.
DCHECK(!render_frame_host_->IsRenderFrameLive());
DCHECK(!render_frame_host_->render_view_host()->IsRenderViewLive());
+ render_frame_host_->ResetLoadingState();
delegate_->RenderProcessGoneFromRenderManager(
render_frame_host_->render_view_host());
}
@@ -2253,7 +2269,11 @@ void RenderFrameHostManager::CancelPending() {
TRACE_EVENT1("navigation", "RenderFrameHostManager::CancelPending",
"FrameTreeNode id", frame_tree_node_->frame_tree_node_id());
render_frame_host_->ClearPendingWebUI();
+
+ bool pending_was_loading = pending_render_frame_host_->is_loading();
DiscardUnusedFrame(UnsetPendingRenderFrameHost());
+ if (pending_was_loading)
+ frame_tree_node_->DidStopLoading();
}
scoped_ptr<RenderFrameHostImpl>
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/browser/site_instance_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698