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

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

Issue 2403813002: Do not create NavigationHandles for inactive RenderFrameHosts (Closed)
Patch Set: 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
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..3f39d0ebd8bce8068ed06303ce2c4a4a2aba2a89 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1038,6 +1038,8 @@ void RenderFrameHostImpl::OnDocumentOnLoadCompleted(
void RenderFrameHostImpl::OnDidStartProvisionalLoad(
const GURL& url,
const base::TimeTicks& navigation_start) {
+ if (!is_active())
nasko 2016/10/10 20:41:11 Do we want to add the same to all navigation relat
clamy 2016/10/11 10:34:27 Added a TODO.
+ return;
frame_tree_node_->navigator()->DidStartProvisionalLoad(this, url,
navigation_start);
}
@@ -1298,13 +1300,8 @@ int RenderFrameHostImpl::GetEnabledBindings() {
void RenderFrameHostImpl::SetNavigationHandle(
std::unique_ptr<NavigationHandleImpl> navigation_handle) {
+ CHECK(!navigation_handle || is_active());
navigation_handle_ = std::move(navigation_handle);
-
- // TODO(clamy): Remove this debug code once we understand better how we get to
- // the point of attempting to transfer a navigation from a RFH that is no
- // longer active.
- if (navigation_handle_ && !is_active())
- base::debug::DumpWithoutCrashing();
nasko 2016/10/10 20:41:10 Why not keep this around instead of the CHECK, in
clamy 2016/10/11 10:34:27 Done.
}
std::unique_ptr<NavigationHandleImpl>
@@ -1792,6 +1789,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(

Powered by Google App Engine
This is Rietveld 408576698