From 588ac782287d7cbe82b71b825f268b8e0f026174 Mon Sep 17 00:00:00 2001 From: "mirandac@chromium.org" Date: Thu, 3 Sep 2009 20:37:57 +0000 Subject: 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 --- chrome/browser/browser_theme_provider.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'chrome/browser/browser_theme_provider.h') 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, 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, 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, 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 ImageSaveCache; - ImageSaveCache image_save_cache_; + // Save the images to be written to disk, mapping file path to id. + typedef std::map ImagesDiskCache; + ImagesDiskCache images_disk_cache_; ResourceBundle& rb_; Profile* profile_; -- cgit v1.1