summaryrefslogtreecommitdiffstats
path: root/chromium/content/browser/renderer_host/navigation_request.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/content/browser/renderer_host/navigation_request.cc')
-rw-r--r--chromium/content/browser/renderer_host/navigation_request.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/chromium/content/browser/renderer_host/navigation_request.cc b/chromium/content/browser/renderer_host/navigation_request.cc
index d979fc0def5..74ead3b0943 100644
--- a/chromium/content/browser/renderer_host/navigation_request.cc
+++ b/chromium/content/browser/renderer_host/navigation_request.cc
@@ -5174,7 +5174,13 @@ void NavigationRequest::CommitErrorPage(
}
}
+ base::WeakPtr<NavigationRequest> weak_self(weak_factory_.GetWeakPtr());
ReadyToCommitNavigation(true /* is_error */);
+ // The caller above might result in the deletion of `this`. Return immediately
+ // if so.
+ if (!weak_self) {
+ return;
+ }
PopulateDocumentTokenForCrossDocumentNavigation();
// Use a separate cache shard, and no cookies, for error pages.