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

Issue 3060047: [Mac] Prevent a crash with the DownloadStartedAnimation. (Closed)

Created:
10 years, 4 months ago by Robert Sesek
Modified:
9 years, 7 months ago
Reviewers:
Nico
CC:
chromium-reviews, John Grabowski, Paul Godavari, pam+watch_chromium.org, ben+cc_chromium.org
Base URL:
http://src.chromium.org/git/chromium.git
Visibility:
Public.

Description

[Mac] Prevent a crash with the DownloadStartedAnimation. The initializer for the class can sometimes return nil. If so, do not try to access an ivar directly. BUG=51307 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=55165

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -1 line) Patch
M chrome/browser/cocoa/download_started_animation_mac.mm View 2 chunks +5 lines, -1 line 0 comments Download

Messages

Total messages: 2 (0 generated)
Robert Sesek
10 years, 4 months ago (2010-08-05 21:52:41 UTC) #1
Nico
10 years, 4 months ago (2010-08-05 21:54:08 UTC) #2
LG

On Thu, Aug 5, 2010 at 2:52 PM,  <rsesek@chromium.org> wrote:
> Reviewers: Nico,
>
> Description:
> [Mac] Prevent a crash with the DownloadStartedAnimation.
>
> The initializer for the class can sometimes return nil.  If so, do not try
> to
> access an ivar directly.
>
> BUG=51307
> TEST=none
>
> Please review this at http://codereview.chromium.org/3060047/show
>
> SVN Base: http://src.chromium.org/git/chromium.git
>
> Affected files:
>  M chrome/browser/cocoa/download_started_animation_mac.mm
>
>
> Index: chrome/browser/cocoa/download_started_animation_mac.mm
> diff --git a/chrome/browser/cocoa/download_started_animation_mac.mm
> b/chrome/browser/cocoa/download_started_animation_mac.mm
> index
>
f756bb043e83884897cdc8ee7ee2fcc92be832a6..dfd7db70206fee945597bb045c9e22be67aa44ed
> 100644
> --- a/chrome/browser/cocoa/download_started_animation_mac.mm
> +++ b/chrome/browser/cocoa/download_started_animation_mac.mm
> @@ -1,4 +1,4 @@
> -// Copyright (c) 2009 The Chromium Authors. All rights reserved.
> +// Copyright (c) 2010 The Chromium Authors. All rights reserved.
>  // Use of this source code is governed by a BSD-style license that can be
>  // found in the LICENSE file.
>  //
> @@ -176,6 +176,10 @@ class DownloadAnimationTabObserver : public
> NotificationObserver {
>   // Will be deleted when the animation is complete in -animationComplete.
>   DownloadStartedAnimationMac* controller =
>       [[self alloc] initWithTabContents:contents];
> +  // The initializer can return nil.
> +  if (!controller)
> +    return;
> +
>   // The |animation_| releaes itself when done.
>   [controller->animation_ startAnimation];
>  }
>
>
>

Powered by Google App Engine
This is Rietveld 408576698