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

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

Issue 14326003: Prevent Chrome from crashing if a tab is closed while the media settings bubble is opea and a setti… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 8 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 | 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 8da51836079251d2f003e8392add0cdfd688d842..e69de7593ac0b62ec082841cf32c6a498d158ea9 100644
--- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
+++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
@@ -446,7 +446,9 @@ ContentSettingCookiesBubbleModel::ContentSettingCookiesBubbleModel(
}
ContentSettingCookiesBubbleModel::~ContentSettingCookiesBubbleModel() {
- if (settings_changed()) {
+ // On some plattforms e.g. MacOS X it is possible to close a tab while the
+ // cookies settubgs bubble is open. This resets the web contents to NULL.
+ if (settings_changed() && web_contents()) {
CollectedCookiesInfoBarDelegate::Create(
InfoBarService::FromWebContents(web_contents()));
}
@@ -610,6 +612,10 @@ ContentSettingMediaStreamBubbleModel::ContentSettingMediaStreamBubbleModel(
}
ContentSettingMediaStreamBubbleModel::~ContentSettingMediaStreamBubbleModel() {
+ // On some plattforms e.g. MacOS X it is possible to close a tab while the
+ // media stream bubble is open. This resets the web contents to NULL.
+ if (!web_contents())
+ return;
bool media_setting_changed = false;
for (MediaMenuMap::const_iterator it = bubble_content().media_menus.begin();
it != bubble_content().media_menus.end(); ++it) {
« 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