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

Issue 460050: Completely redo how themes are stored on disk and processed at install time. (Closed)

Created:
11 years ago by Elliot Glaysher
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, brettw+cc_chromium.org, ben+cc_chromium.org, John Grabowski, Erik does not do reviews, Paul Godavari, Aaron Boodman, pam+watch_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Completely redo how themes are stored on disk and processed at install time. Rewrites most of BrowserThemeProvider and adds a new class BrowserThemePack. BrowserThemePack takes all the logic of generating resources out of the BrowserThemeProvider, does all of them at theme install time (previously, we lazily generated all the button images and a good number of colors, which muddled logic quite a bit), and then writes all the data out into an mmap()able file to speed startup when a theme is installed. In addition, this changes how the GtkThemeProvider works. The GtkThemeProvider now generates all of its images lazily and doesn't reach into the implementation details of BrowserThemeProvider as it used to. BUG=24493, 21121 TEST=All the new unit tests pass. All the complex theme startup tests go faster. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=34379

Patch Set 1 #

Patch Set 2 : Modifications to make stuff work with the Mac. #

Patch Set 3 : Compile fixes for windows #

Patch Set 4 : Add unit test / fix hsl storage #

Patch Set 5 : Final cleanup before review #

Total comments: 1

Patch Set 6 : Fix the gypi files after the previous refactoring. #

Total comments: 14

Patch Set 7 : Moved values back to BrowserThemeProvider after talking to tony #

Total comments: 26

Patch Set 8 : Updates to DataPack #

Total comments: 12

Patch Set 9 : First round of review changes #

Total comments: 1

Patch Set 10 : Fixes for mac and NULL change. #

Patch Set 11 : More fixes #

Patch Set 12 : 80 col nits #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+1885 lines, -1559 lines) Patch
M base/base.gyp View 3 1 chunk +0 lines, -1 line 0 comments Download
M base/base.gypi View 1 chunk +0 lines, -1 line 0 comments Download
M base/data_pack.h View 1 2 3 4 5 6 7 2 chunks +8 lines, -2 lines 0 comments Download
M base/data_pack.cc View 1 2 3 4 5 6 7 8 7 chunks +84 lines, -13 lines 0 comments Download
M base/data_pack_unittest.cc View 1 2 3 4 5 6 7 8 2 chunks +43 lines, -11 lines 0 comments Download
A chrome/browser/browser_theme_pack.h View 1 2 3 4 5 6 7 8 9 1 chunk +193 lines, -0 lines 2 comments Download
A chrome/browser/browser_theme_pack.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +865 lines, -0 lines 0 comments Download
A chrome/browser/browser_theme_pack_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +335 lines, -0 lines 0 comments Download
M chrome/browser/browser_theme_provider.h View 1 2 3 4 5 6 7 8 6 chunks +13 lines, -200 lines 0 comments Download
M chrome/browser/browser_theme_provider.cc View 1 2 3 4 5 6 7 8 9 15 chunks +141 lines, -964 lines 2 comments Download
M chrome/browser/browser_theme_provider_mac.mm View 1 2 3 4 5 6 7 3 chunks +5 lines, -6 lines 0 comments Download
M chrome/browser/browser_theme_provider_unittest.cc View 3 chunks +2 lines, -177 lines 0 comments Download
M chrome/browser/cocoa/download_shelf_controller.mm View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/extensions/theme_installed_infobar_delegate.cc View 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/gtk/download_shelf_gtk.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/gtk/gtk_theme_provider.h View 5 chunks +30 lines, -14 lines 0 comments Download
M chrome/browser/gtk/gtk_theme_provider.cc View 1 2 3 4 5 6 8 chunks +150 lines, -69 lines 0 comments Download
M chrome/browser/gtk/gtk_theme_provider_unittest.cc View 1 2 3 4 5 6 7 8 3 chunks +5 lines, -70 lines 0 comments Download
M chrome/browser/profile.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
chrome/chrome_tests.gypi View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_constants.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/chrome_constants.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/pref_names.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
chrome/common/pref_names.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
D chrome/test/data/profiles/complex_theme/Default/Cached Theme Images/theme_frame_inactive View 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/test/data/profiles/complex_theme/Default/Cached Theme Images/theme_frame_incognito View 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/test/data/profiles/complex_theme/Default/Cached Theme Images/theme_frame_incognito_inactive View 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/test/data/profiles/complex_theme/Default/Cached Theme Images/theme_frame_original View 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/test/data/profiles/complex_theme/Default/Cached Theme Images/theme_tab_background_incognito View 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/test/data/profiles/complex_theme/Default/Cached Theme Images/theme_tab_background_original View 0 chunks +-1 lines, --1 lines 0 comments Download
A chrome/test/data/profiles/complex_theme/Default/Extensions/mblmlcbknbnfebdfjnolmcapmdofhmme/1.1/Cached Theme.pak View 0 chunks +-1 lines, --1 lines 0 comments Download
M chrome/test/data/profiles/complex_theme/Default/PreferencesTemplate View 4 5 6 7 8 9 10 1 chunk +1 line, -32 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
Elliot Glaysher
Miranda OR Glen: The majority of the patch. Avi: Because he wanted to be on ...
11 years ago (2009-12-09 22:13:11 UTC) #1
Evan Martin
only data pack bits http://codereview.chromium.org/460050/diff/7001/8005 File base/data_pack.cc (right): http://codereview.chromium.org/460050/diff/7001/8005#newcode136 base/data_pack.cc:136: fwrite(&kFileFormatVersion, 1, sizeof(uint32_t), file); You ...
11 years ago (2009-12-09 22:56:57 UTC) #2
tony
http://codereview.chromium.org/460050/diff/7001/8005 File base/data_pack.cc (right): http://codereview.chromium.org/460050/diff/7001/8005#newcode22 base/data_pack.cc:22: #pragma pack(push,1) Should this be pack(push,4)? http://codereview.chromium.org/460050/diff/7001/8005#newcode42 base/data_pack.cc:42: Can ...
11 years ago (2009-12-10 00:03:21 UTC) #3
Miranda Callahan
This is really awesome! Have you stress-tested it by trying to install multiple themes in ...
11 years ago (2009-12-10 00:53:44 UTC) #4
Paweł Hajdan Jr.
Drive-by with some unit test nits. Generally with these fixes they would be a little ...
11 years ago (2009-12-10 07:28:28 UTC) #5
Avi (use Gerrit)
I see what you're doing here; awesome. Was added as FYI so I'm not doing ...
11 years ago (2009-12-10 19:11:08 UTC) #6
Elliot Glaysher
Tony: I just want to verify that the change you want me to make to ...
11 years ago (2009-12-10 21:46:17 UTC) #7
tony
> Tony: I just want to verify that the change you want me to make ...
11 years ago (2009-12-10 21:59:11 UTC) #8
Elliot Glaysher
On 2009/12/10 21:59:11, tony wrote: > Yes, I was just suggesting having a termination entry ...
11 years ago (2009-12-10 22:17:44 UTC) #9
Elliot Glaysher
On 2009/12/10 21:59:11, tony wrote: > I mean add: > DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); > here. The problem ...
11 years ago (2009-12-10 22:24:13 UTC) #10
tony
On 2009/12/10 22:17:44, Elliot Glaysher wrote: > OK, I was right. There was a failure ...
11 years ago (2009-12-10 22:24:53 UTC) #11
Elliot Glaysher
Updated. All green on the trybots.
11 years ago (2009-12-11 00:32:58 UTC) #12
tony
Last 2 comments, the rest is looking really good. http://codereview.chromium.org/460050/diff/13003/12008 File chrome/browser/browser_theme_pack.h (right): http://codereview.chromium.org/460050/diff/13003/12008#newcode43 chrome/browser/browser_theme_pack.h:43: ...
11 years ago (2009-12-11 19:14:22 UTC) #13
Elliot Glaysher
http://codereview.chromium.org/460050/diff/13003/12008 File chrome/browser/browser_theme_pack.h (right): http://codereview.chromium.org/460050/diff/13003/12008#newcode43 chrome/browser/browser_theme_pack.h:43: static scoped_refptr<BrowserThemePack> BuildFromExtension( On 2009/12/11 19:14:23, tony wrote: > ...
11 years ago (2009-12-11 19:35:38 UTC) #14
Miranda Callahan
All the hard stuff was in Tony's parts. LGTM on the theme changing goodness. On ...
11 years ago (2009-12-11 19:36:55 UTC) #15
tony
11 years ago (2009-12-11 19:46:50 UTC) #16
From offline discussion: BuildFromExtension will return just a pointer and
BuildFromDataPack will return the scoped_refptr with a comment in the header
explaining why it's like that.

With those changes, LGTM!

Powered by Google App Engine
This is Rietveld 408576698