summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorskuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-11 04:48:52 +0000
committerskuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-11 04:48:52 +0000
commit4410c2c697a5a2d5e97474c5b754e267d58fc191 (patch)
tree8c79093d857417320c86f42dc3f70bbc80510147 /ash
parentce2086ee8e0d93cfb293859b0251cf12ed057f9f (diff)
downloadchromium_src-4410c2c697a5a2d5e97474c5b754e267d58fc191.zip
chromium_src-4410c2c697a5a2d5e97474c5b754e267d58fc191.tar.gz
chromium_src-4410c2c697a5a2d5e97474c5b754e267d58fc191.tar.bz2
Fixing notification crasher when opening of the tray menu falls together with the opeing of a message
The problem was that between creating the |system_bubble_| and the finishing of the initialization, a message was trying to show. Since the system_bubble_ is at that point in time not fully initialized, the fast user clicking can cause a crash due to access to the |system_bubble_|. BUG=247416 TEST=visual Review URL: https://chromiumcodereview.appspot.com/16395004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205416 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/system/tray/system_tray.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc
index 1693058..677c710 100644
--- a/ash/system/tray/system_tray.cc
+++ b/ash/system/tray/system_tray.cc
@@ -453,7 +453,13 @@ void SystemTray::UpdateNotificationBubble() {
this, notification_items_, SystemTrayBubble::BUBBLE_TYPE_NOTIFICATION);
views::View* anchor;
TrayBubbleView::AnchorType anchor_type;
- if (system_bubble_.get() && system_bubble_->bubble_view()) {
+ // Tray items might want to show notifications while we are creating and
+ // initializing the |system_bubble_| - but it might not be fully initialized
+ // when coming here - this would produce a crashed like crbug.com/247416.
+ // As such we check the existence of the widget here.
+ if (system_bubble_.get() &&
+ system_bubble_->bubble_view() &&
+ system_bubble_->bubble_view()->GetWidget()) {
anchor = system_bubble_->bubble_view();
anchor_type = TrayBubbleView::ANCHOR_TYPE_BUBBLE;
} else {