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

Issue 173445: Cache GTMTheme across windows to avoid re-creating it every time we create a ... (Closed)

Created:
11 years, 4 months ago by pink (ping after 24hrs)
Modified:
9 years, 7 months ago
Reviewers:
Mark Mentovai
CC:
chromium-reviews_googlegroups.com, John Grabowski, Ben Goodger (Google)
Visibility:
Public.

Description

Cache GTMTheme across windows to avoid re-creating it every time we create a new window. Cache gradient to avoid re-creating it every time we draw a button cell. BUG=none TEST=switch themes, ensure it works. Make sure buttons draw correctly. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=24441

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -10 lines) Patch
M chrome/browser/cocoa/browser_window_controller.mm View 1 chunk +10 lines, -1 line 2 comments Download
M chrome/browser/cocoa/gradient_button_cell.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/cocoa/gradient_button_cell.mm View 4 chunks +12 lines, -8 lines 2 comments Download

Messages

Total messages: 3 (0 generated)
pink (ping after 24hrs)
11 years, 4 months ago (2009-08-26 01:20:11 UTC) #1
Mark Mentovai
lg http://codereview.chromium.org/173445/diff/1/2 File chrome/browser/cocoa/browser_window_controller.mm (right): http://codereview.chromium.org/173445/diff/1/2#newcode1207 Line 1207: static std::map<ThemeKey, GTMTheme*> cache; I think that ...
11 years, 4 months ago (2009-08-26 01:25:49 UTC) #2
pink (ping after 24hrs)
11 years, 4 months ago (2009-08-26 14:55:56 UTC) #3
http://codereview.chromium.org/173445/diff/1/2
File chrome/browser/cocoa/browser_window_controller.mm (right):

http://codereview.chromium.org/173445/diff/1/2#newcode1207
Line 1207: static std::map<ThemeKey, GTMTheme*> cache;
On 2009/08/26 01:25:49, Mark Mentovai wrote:
> I think that every place we have a static that leaks its garbage we should put
a
> comment like "this might be a candidate for a Singleton or a LazyInstance" so
> that if we ever decide we want to make things singletons or lazy instances, we
> can go through and do them easily.

Done.

http://codereview.chromium.org/173445/diff/1/3
File chrome/browser/cocoa/gradient_button_cell.mm (right):

http://codereview.chromium.org/173445/diff/1/3#newcode35
Line 35: shouldTheme_ = YES;
On 2009/08/26 01:25:49, Mark Mentovai wrote:
> Indent is weird.

Done.

Powered by Google App Engine
This is Rietveld 408576698