diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-04 08:31:16 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-04 08:31:16 +0000 |
commit | 2bc70b08e10e985b635273f395bac10b7ef54dc9 (patch) | |
tree | 591e82501104c4a6ff4a17a6c2b98fce596a2d06 /chrome/browser/ui/cocoa/image_button_cell.h | |
parent | f6395a362d7d325b80de13f314ac1ff94d2a68c1 (diff) | |
download | chromium_src-2bc70b08e10e985b635273f395bac10b7ef54dc9.zip chromium_src-2bc70b08e10e985b635273f395bac10b7ef54dc9.tar.gz chromium_src-2bc70b08e10e985b635273f395bac10b7ef54dc9.tar.bz2 |
mac: attempt to fix a startup perf regression after r174653
BUG=168084
Review URL: https://chromiumcodereview.appspot.com/11647050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175123 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/cocoa/image_button_cell.h')
-rw-r--r-- | chrome/browser/ui/cocoa/image_button_cell.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/browser/ui/cocoa/image_button_cell.h b/chrome/browser/ui/cocoa/image_button_cell.h index 8d64c1e..74feb94 100644 --- a/chrome/browser/ui/cocoa/image_button_cell.h +++ b/chrome/browser/ui/cocoa/image_button_cell.h @@ -36,7 +36,11 @@ enum ButtonState { // state. Images are specified by image IDs. @interface ImageButtonCell : NSButtonCell { @private - scoped_nsobject<NSImage> image_[image_button_cell::kButtonStateCount]; + struct { + // At most one of these two fields will be non-null. + int imageId; + scoped_nsobject<NSImage> image; + } image_[image_button_cell::kButtonStateCount]; NSInteger overlayImageID_; BOOL isMouseInside_; } @@ -45,7 +49,8 @@ enum ButtonState { @property(assign, nonatomic) BOOL isMouseInside; // Sets the image for the given button state using an image ID. -// The image will be loaded from a resource pak. +// The image will be lazy loaded from a resource pak -- important because +// this is in the hot path for startup. - (void)setImageID:(NSInteger)imageID forButtonState:(image_button_cell::ButtonState)state; |