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

Issue 7282036: Fix crash when clicking the close button on a closing infobar. (Closed)

Created:
9 years, 5 months ago by Peter Kasting
Modified:
9 years, 5 months ago
Reviewers:
Elliot Glaysher
CC:
chromium-reviews, Avi (use Gerrit), brettw-cc_chromium.org
Visibility:
Public.

Description

Fix crash when clicking the close button on a closing infobar. BUG=88136 TEST=Double-clicking an infobar close button should not cause a crash. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=91321

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -1 line) Patch
M chrome/browser/tab_contents/infobar.cc View 1 chunk +6 lines, -1 line 0 comments Download

Messages

Total messages: 2 (0 generated)
Peter Kasting
9 years, 5 months ago (2011-07-01 17:44:25 UTC) #1
Elliot Glaysher
9 years, 5 months ago (2011-07-01 17:45:00 UTC) #2
LGTM

On Fri, Jul 1, 2011 at 10:44 AM,  <pkasting@chromium.org> wrote:
> Reviewers: Elliot Glaysher,
>
> Description:
> Fix crash when clicking the close button on a closing infobar.
>
> BUG=88136
> TEST=Double-clicking an infobar close button should not cause a crash.
>
> Please review this at http://codereview.chromium.org/7282036/
>
> SVN Base: svn://chrome-svn/chrome/trunk/src/
>
> Affected files:
>  M     chrome/browser/tab_contents/infobar.cc
>
>
> Index: chrome/browser/tab_contents/infobar.cc
> ===================================================================
> --- chrome/browser/tab_contents/infobar.cc      (revision 91189)
> +++ chrome/browser/tab_contents/infobar.cc      (working copy)
> @@ -101,7 +101,12 @@
>  }
>
>  void InfoBar::RemoveInfoBar() {
> -  if (!delegate_)
> +  // If the user clicks the close button when the infobar is already
> closing
> +  // (e.g. because this is the second click of a double-click on the
> button),
> +  // |owner_| can be NULL here, in which case we don't want to call
> +  // InfoBarDismissed() either (since this can lead to us double-recording
> +  // dismissals).
> +  if (!delegate_ || !owner_)
>     return;
>   delegate_->InfoBarDismissed();
>   owner_->RemoveInfoBar(delegate_);
>
>
>

Powered by Google App Engine
This is Rietveld 408576698