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

Unified Diff: chrome/browser/ui/webui/interstitials/interstitial_ui.cc

Issue 2618573002: Add test to check for crash caused by stale WebContents in chrome://interstitials (Closed)
Patch Set: Fix browser side navigation Created 3 years, 11 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 | chrome/browser/ui/webui/interstitials/interstitial_ui_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/interstitials/interstitial_ui.cc
diff --git a/chrome/browser/ui/webui/interstitials/interstitial_ui.cc b/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
index 5185dacb1c3339358b9932793521ffbc6a0a4946..0f6e454d4d7f26c7f133632fbb5556e90525aaef 100644
--- a/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
+++ b/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
@@ -343,6 +343,11 @@ void InterstitialHTMLSource::StartDataRequest(
const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
const content::URLDataSource::GotDataCallback& callback) {
content::WebContents* web_contents = wc_getter.Run();
+ if (!web_contents) {
+ // When browser-side navigation is enabled, web_contents can be null if
+ // the tab is closing. Nothing to do in this case.
+ return;
+ }
std::unique_ptr<content::InterstitialPageDelegate> interstitial_delegate;
if (base::StartsWith(path, "ssl", base::CompareCase::SENSITIVE)) {
interstitial_delegate.reset(CreateSSLBlockingPage(web_contents));
« no previous file with comments | « no previous file | chrome/browser/ui/webui/interstitials/interstitial_ui_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698