Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Unified Diff: chrome/browser/browser_theme_provider.h

Issue 115478: Track and free generated images in the browser theme provider. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/browser_theme_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_theme_provider.h
===================================================================
--- chrome/browser/browser_theme_provider.h (revision 16307)
+++ chrome/browser/browser_theme_provider.h (working copy)
@@ -2,9 +2,13 @@
// 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"
#include "base/non_thread_safe.h"
@@ -15,10 +19,9 @@
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 @@
// 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 @@
DISALLOW_COPY_AND_ASSIGN(BrowserThemeProvider);
};
-#endif // CHROME_BROWSER_THEME_PROVIDER_H_
+#endif // CHROME_BROWSER_BROWSER_THEME_PROVIDER_H_
« no previous file with comments | « no previous file | chrome/browser/browser_theme_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698