summaryrefslogtreecommitdiffstats
path: root/chrome/browser/themes
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-04 20:57:44 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-04 20:57:44 +0000
commit14bb336e4be8a0e230950c068ce66db41105ba76 (patch)
tree529aa6ca7fa7c1590172773586e6842dd6bc6991 /chrome/browser/themes
parent4c802db54be1b757511ea22a72bbb57b30750668 (diff)
downloadchromium_src-14bb336e4be8a0e230950c068ce66db41105ba76.zip
chromium_src-14bb336e4be8a0e230950c068ce66db41105ba76.tar.gz
chromium_src-14bb336e4be8a0e230950c068ce66db41105ba76.tar.bz2
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
Diffstat (limited to 'chrome/browser/themes')
-rw-r--r--chrome/browser/themes/browser_theme_pack.cc16
-rw-r--r--chrome/browser/themes/browser_theme_pack.h4
2 files changed, 11 insertions, 9 deletions
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 <limits>
+
#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<uint16>::max() - 1;
+const int kTintsID = std::numeric_limits<uint16>::max() - 2;
+const int kColorsID = std::numeric_limits<uint16>::max() - 3;
+const int kDisplayPropertiesID = std::numeric_limits<uint16>::max() - 4;
+const int kSourceImagesID = std::numeric_limits<uint16>::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<int, scoped_refptr<RefCountedMemory> > RawImages;
- // The type passed to base::DataPack::WritePack.
- typedef std::map<uint32, base::StringPiece> RawDataForWriting;
+ // The type passed to ui::DataPack::WritePack.
+ typedef std::map<uint16, base::StringPiece> RawDataForWriting;
// An association between an id and the FilePath that has the image data.
typedef std::map<int, FilePath> FilePathMap;