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

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

Issue 1759123002: Ensure RenderFrameHost & NavigationHandle are not destroyed during commit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/navigation_handle_impl.cc
diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc
index 05a6a947aa783bfdd0f5ef0c3cee5da09ad343f7..2bb284d1e86a015d37818ec7e9d589dc1aa4e87a 100644
--- a/content/browser/frame_host/navigation_handle_impl.cc
+++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -65,7 +65,8 @@ NavigationHandleImpl::NavigationHandleImpl(
frame_tree_node_(frame_tree_node),
next_index_(0),
navigation_start_(navigation_start),
- pending_nav_entry_id_(pending_nav_entry_id) {
+ pending_nav_entry_id_(pending_nav_entry_id),
+ is_in_commit_(false) {
DCHECK(!navigation_start.is_null());
GetDelegate()->DidStartNavigation(this);
}
@@ -73,6 +74,8 @@ NavigationHandleImpl::NavigationHandleImpl(
NavigationHandleImpl::~NavigationHandleImpl() {
GetDelegate()->DidFinishNavigation(this);
+ CHECK(!is_in_commit_);
+
// Cancel the navigation on the IO thread if the NavigationHandle is being
// destroyed in the middle of the NavigationThrottles checks.
if (!IsBrowserSideNavigationEnabled() && !complete_callback_.is_null())

Powered by Google App Engine
This is Rietveld 408576698