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

Unified Diff: chrome/browser/ui/content_settings/content_setting_bubble_model.cc

Issue 791633003: Fix a crash on closing tab while the plugin settings bubble is visible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review. Created 6 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/content_settings/content_setting_bubble_model.cc
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
index 1e3433a5ca01d000f1854756f0ec8aa07225a17a..d8bd45b02e6701647b234967d1eb9b92822c3340 100644
--- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
+++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
@@ -497,7 +497,10 @@ ContentSettingPluginBubbleModel::~ContentSettingPluginBubbleModel() {
void ContentSettingPluginBubbleModel::OnCustomLinkClicked() {
content::RecordAction(UserMetricsAction("ClickToPlay_LoadAll_Bubble"));
- DCHECK(web_contents());
+ // Web contents can be NULL if the tab was closed while the plugins
+ // settings bubble is visible.
+ if (!web_contents())
+ return;
#if defined(ENABLE_PLUGINS)
// TODO(bauerb): We should send the identifiers of blocked plug-ins here.
ChromePluginServiceFilter::GetInstance()->AuthorizeAllPlugins(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698