diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-18 21:10:09 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-18 21:10:09 +0000 |
commit | 256e43f5af154eed4bbef574adb0ed29d988246e (patch) | |
tree | 2a4c9227cd2e2d4df2aa89850f8389a54b0e2a5c /chrome/browser/browser_theme_provider.h | |
parent | 43b7725b6686228f86ef1306703e6dade09dcc27 (diff) | |
download | chromium_src-256e43f5af154eed4bbef574adb0ed29d988246e.zip chromium_src-256e43f5af154eed4bbef574adb0ed29d988246e.tar.gz chromium_src-256e43f5af154eed4bbef574adb0ed29d988246e.tar.bz2 |
Track and free generated images in the browser theme provider.
Review URL: http://codereview.chromium.org/115478
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16311 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_theme_provider.h')
-rw-r--r-- | chrome/browser/browser_theme_provider.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/chrome/browser/browser_theme_provider.h b/chrome/browser/browser_theme_provider.h index d9996f0c..b6a2e84 100644 --- a/chrome/browser/browser_theme_provider.h +++ b/chrome/browser/browser_theme_provider.h @@ -2,8 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_THEME_PROVIDER_H_ -#define CHROME_BROWSER_THEME_PROVIDER_H_ +#ifndef CHROME_BROWSER_BROWSER_THEME_PROVIDER_H_ +#define CHROME_BROWSER_BROWSER_THEME_PROVIDER_H_ + +#include <map> +#include <string> +#include <vector> #include "app/resource_bundle.h" #include "app/theme_provider.h" @@ -15,10 +19,9 @@ class Extension; class Profile; class DictionaryValue; -class BrowserThemeProvider : - public base::RefCounted<BrowserThemeProvider>, - public NonThreadSafe, - public ThemeProvider { +class BrowserThemeProvider : public base::RefCounted<BrowserThemeProvider>, + public NonThreadSafe, + public ThemeProvider { public: BrowserThemeProvider(); virtual ~BrowserThemeProvider(); @@ -109,11 +112,18 @@ class BrowserThemeProvider : // Load theme data from preferences. void LoadThemePrefs(); + // Frees generated images and clears the image cache. + void FreeImages(); + // Cached images. We cache all retrieved and generated bitmaps and keep // track of the pointers. typedef std::map<int, SkBitmap*> ImageCache; ImageCache image_cache_; + // List of generate images that aren't stored in ResourceBundles image cache + // and need to be freed. + std::vector<SkBitmap*> generated_images_; + ResourceBundle& rb_; Profile* profile_; @@ -124,4 +134,4 @@ class BrowserThemeProvider : DISALLOW_COPY_AND_ASSIGN(BrowserThemeProvider); }; -#endif // CHROME_BROWSER_THEME_PROVIDER_H_ +#endif // CHROME_BROWSER_BROWSER_THEME_PROVIDER_H_ |