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

Unified Diff: chrome/browser/ui/cocoa/image_button_cell.h

Issue 11647050: mac: attempt to fix a startup perf regression after r174653 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 7 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/image_button_cell.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/image_button_cell.h
diff --git a/chrome/browser/ui/cocoa/image_button_cell.h b/chrome/browser/ui/cocoa/image_button_cell.h
index 8d64c1e97f3d1f1cd93606ad1dea6d2bd9cd2ce0..74feb94c36e0fce1b58b3fd322dcf77de3926513 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;
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/image_button_cell.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698