diff options
author | mirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-03 20:37:57 +0000 |
---|---|---|
committer | mirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-03 20:37:57 +0000 |
commit | 588ac782287d7cbe82b71b825f268b8e0f026174 (patch) | |
tree | 7be40341de53711f2624eb008ed67beb993e15a8 /chrome/browser/browser_theme_provider.h | |
parent | cb5fb563c6b182cd40441736bf049cc6b5c9b8d2 (diff) | |
download | chromium_src-588ac782287d7cbe82b71b825f268b8e0f026174.zip chromium_src-588ac782287d7cbe82b71b825f268b8e0f026174.tar.gz chromium_src-588ac782287d7cbe82b71b825f268b8e0f026174.tar.bz2 |
Fix theme cache corruption.
BUG= http://crbug.com/20957
TEST= Install many themes quickly, with many windows open. Close browser and reopen. Theme should not be corrupted.
Review URL: http://codereview.chromium.org/197010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25359 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_theme_provider.h')
-rw-r--r-- | chrome/browser/browser_theme_provider.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/chrome/browser/browser_theme_provider.h b/chrome/browser/browser_theme_provider.h index f1475b2..0053ef2 100644 --- a/chrome/browser/browser_theme_provider.h +++ b/chrome/browser/browser_theme_provider.h @@ -303,6 +303,9 @@ class BrowserThemeProvider : public base::RefCounted<BrowserThemeProvider>, void SaveTintData(); void SaveDisplayPropertyData(); + // Save the paths of data we have written to disk in prefs. + void SaveCachedImageData(); + // Save the id of the last theme installed. void SaveThemeID(const std::string& id); @@ -314,7 +317,7 @@ class BrowserThemeProvider : public base::RefCounted<BrowserThemeProvider>, void FreePlatformCaches(); // Encode image at image_cache_[id] as PNG and write to disk. - void WriteImagesToDisk(); + bool WriteImagesToDisk(); // Do we have a custom frame image or custom tints? bool ShouldTintFrames(); @@ -339,10 +342,9 @@ class BrowserThemeProvider : public base::RefCounted<BrowserThemeProvider>, NSColorMap nscolor_cache_; #endif - // We save here the images to be written to disk, along with the file paths - // where they are to be written. - typedef std::map<FilePath, SkBitmap*> ImageSaveCache; - ImageSaveCache image_save_cache_; + // Save the images to be written to disk, mapping file path to id. + typedef std::map<FilePath, int> ImagesDiskCache; + ImagesDiskCache images_disk_cache_; ResourceBundle& rb_; Profile* profile_; |