Skip to content

Commit

Permalink
Fixing notification crasher when opening of the tray menu falls toget…
Browse files Browse the repository at this point in the history
…her 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
  • Loading branch information
skuhne@chromium.org committed Jun 11, 2013
1 parent ce2086e commit 4410c2c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ash/system/tray/system_tray.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4410c2c

Please sign in to comment.