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

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

Issue 2403813002: Do not create NavigationHandles for inactive RenderFrameHosts (Closed)
Patch Set: Addressed commments + Rebase Created 4 years, 2 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 | « no previous file | content/browser/frame_host/render_frame_host_manager_unittest.cc » ('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_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 1cbc21c45a3e545729ba08a44968c432bd7e456b..a0bd7a4cab1230aa9b31931e38929ef992a59942 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1038,6 +1038,11 @@ void RenderFrameHostImpl::OnDocumentOnLoadCompleted(
void RenderFrameHostImpl::OnDidStartProvisionalLoad(
const GURL& url,
const base::TimeTicks& navigation_start) {
+ // TODO(clamy): Check if other navigation methods (OpenURL,
+ // DidFailProvisionalLoad, ...) should also be ignored if the RFH is no longer
+ // active.
+ if (!is_active())
+ return;
frame_tree_node_->navigator()->DidStartProvisionalLoad(this, url,
navigation_start);
}
@@ -1792,6 +1797,8 @@ void RenderFrameHostImpl::OnBeginNavigation(
const CommonNavigationParams& common_params,
const BeginNavigationParams& begin_params) {
CHECK(IsBrowserSideNavigationEnabled());
+ if (!is_active())
+ return;
CommonNavigationParams validated_params = common_params;
GetProcess()->FilterURL(false, &validated_params.url);
frame_tree_node()->navigator()->OnBeginNavigation(
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698