From 14bb336e4be8a0e230950c068ce66db41105ba76 Mon Sep 17 00:00:00 2001 From: "tony@chromium.org" Date: Thu, 4 Aug 2011 20:57:44 +0000 Subject: Update the .pak file format to version 2: Make resource ids 16bit values instead of 32bit values. On gzip compressed locales files, this saves 17k total. Bump the cached theme pak version so the caches get rebuilt. BUG=76285 TEST=Covered by unit tests and manually tested installing themes. Review URL: http://codereview.chromium.org/7555003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95487 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/themes/browser_theme_pack.cc | 16 +++++++++------- chrome/browser/themes/browser_theme_pack.h | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'chrome/browser/themes') diff --git a/chrome/browser/themes/browser_theme_pack.cc b/chrome/browser/themes/browser_theme_pack.cc index 6b1f940..ad76008 100644 --- a/chrome/browser/themes/browser_theme_pack.cc +++ b/chrome/browser/themes/browser_theme_pack.cc @@ -4,6 +4,8 @@ #include "chrome/browser/themes/browser_theme_pack.h" +#include + #include "base/stl_util.h" #include "base/string_util.h" #include "base/threading/thread_restrictions.h" @@ -27,18 +29,18 @@ namespace { // Version number of the current theme pack. We just throw out and rebuild // theme packs that aren't int-equal to this. -const int kThemePackVersion = 15; +const int kThemePackVersion = 16; // IDs that are in the DataPack won't clash with the positive integer -// int32_t. kHeaderID should always have the maximum value because we want the +// uint16. kHeaderID should always have the maximum value because we want the // "header" to be written last. That way we can detect whether the pack was // successfully written and ignore and regenerate if it was only partially // written (i.e. chrome crashed on a different thread while writing the pack). -const int kHeaderID = UINT_MAX - 1; -const int kTintsID = UINT_MAX - 2; -const int kColorsID = UINT_MAX - 3; -const int kDisplayPropertiesID = UINT_MAX - 4; -const int kSourceImagesID = UINT_MAX - 5; +const int kHeaderID = std::numeric_limits::max() - 1; +const int kTintsID = std::numeric_limits::max() - 2; +const int kColorsID = std::numeric_limits::max() - 3; +const int kDisplayPropertiesID = std::numeric_limits::max() - 4; +const int kSourceImagesID = std::numeric_limits::max() - 5; // Static size of the tint/color/display property arrays that are mmapped. const int kTintArraySize = 6; diff --git a/chrome/browser/themes/browser_theme_pack.h b/chrome/browser/themes/browser_theme_pack.h index c208751..fb748e9 100644 --- a/chrome/browser/themes/browser_theme_pack.h +++ b/chrome/browser/themes/browser_theme_pack.h @@ -103,8 +103,8 @@ class BrowserThemePack : public base::RefCountedThreadSafe< // The raw PNG memory associated with a certain id. typedef std::map > RawImages; - // The type passed to base::DataPack::WritePack. - typedef std::map RawDataForWriting; + // The type passed to ui::DataPack::WritePack. + typedef std::map RawDataForWriting; // An association between an id and the FilePath that has the image data. typedef std::map FilePathMap; -- cgit v1.1