diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-05 20:52:56 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-05 20:52:56 +0000 |
commit | f94614d873ea7983b042dd37448c1b2e3aa82712 (patch) | |
tree | 535393177f93bbbf112912d6ff709049f67bb027 /chrome/browser/browser_theme_pack.h | |
parent | c8b167495aecf707875451ee9fb31331057f3bb8 (diff) | |
download | chromium_src-f94614d873ea7983b042dd37448c1b2e3aa82712.zip chromium_src-f94614d873ea7983b042dd37448c1b2e3aa82712.tar.gz chromium_src-f94614d873ea7983b042dd37448c1b2e3aa82712.tar.bz2 |
Don't crash when a theme specifies a non-existant image.
Fixes the current TopCrasher.
BUG=31719
TEST=BrowserThemePackTest.TestNonExistantImages
Review URL: http://codereview.chromium.org/572039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38242 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_theme_pack.h')
-rw-r--r-- | chrome/browser/browser_theme_pack.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/chrome/browser/browser_theme_pack.h b/chrome/browser/browser_theme_pack.h index 656dc77..e9327e4 100644 --- a/chrome/browser/browser_theme_pack.h +++ b/chrome/browser/browser_theme_pack.h @@ -40,7 +40,8 @@ class BrowserThemePack : public base::RefCountedThreadSafe<BrowserThemePack> { ~BrowserThemePack(); // Builds the theme pack from all data from |extension|. This is often done - // on a separate thread as it takes so long. + // on a separate thread as it takes so long. This can fail and return NULL in + // the case where the theme has invalid data. static BrowserThemePack* BuildFromExtension(Extension* extension); // Builds the theme pack from a previously performed WriteToDisk(). This @@ -118,8 +119,9 @@ class BrowserThemePack : public base::RefCountedThreadSafe<BrowserThemePack> { // Creates the data for |source_images_| from |file_paths|. void BuildSourceImagesArray(const FilePathMap& file_paths); - // Loads the unmodified bitmaps packed in the extension to SkBitmaps. - void LoadRawBitmapsTo(const FilePathMap& file_paths, + // Loads the unmodified bitmaps packed in the extension to SkBitmaps. Returns + // true if all images loaded. + bool LoadRawBitmapsTo(const FilePathMap& file_paths, ImageCache* raw_bitmaps); // Creates tinted and composited frame images. Source and destination is |