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

Unified Diff: chrome/browser/browser_theme_provider.h

Issue 288005: First fix to minimize copying of image data. (Closed)
Patch Set: Modify gyp Created 11 years, 2 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
Index: chrome/browser/browser_theme_provider.h
diff --git a/chrome/browser/browser_theme_provider.h b/chrome/browser/browser_theme_provider.h
index 02fec9b51cf86caaf33a9c8a9cc244d7d6bc2b28..f54c3ca8178f7a10dec278eb69fde2867f4a0a7d 100644
--- a/chrome/browser/browser_theme_provider.h
+++ b/chrome/browser/browser_theme_provider.h
@@ -162,7 +162,7 @@ class BrowserThemeProvider : public NonThreadSafe,
virtual bool GetDisplayProperty(int id, int* result) const;
virtual bool ShouldUseNativeFrame() const;
virtual bool HasCustomImage(int id) const;
- virtual bool GetRawData(int id, std::vector<unsigned char>* raw_data) const;
+ virtual RefCountedMemory* GetRawData(int id) const;
#if defined(OS_LINUX)
virtual GdkPixbuf* GetPixbufNamed(int id) const;
virtual GdkPixbuf* GetRTLEnabledPixbufNamed(int id) const;
@@ -188,7 +188,7 @@ class BrowserThemeProvider : public NonThreadSafe,
// Reads the image data from the theme file into the specified vector. Returns
// true on success.
- bool ReadThemeFileData(int id, std::vector<unsigned char>* raw_data) const;
+ RefCountedMemory* ReadThemeFileData(int id) const;
// Convert a bitfield alignment into a string like "top left". Public so that
// it can be used to generate CSS values. Takes a bitfield of AlignmentMasks.
@@ -277,7 +277,7 @@ class BrowserThemeProvider : public NonThreadSafe,
typedef std::map<const std::string, SkColor> ColorMap;
typedef std::map<const std::string, color_utils::HSL> TintMap;
typedef std::map<const std::string, int> DisplayPropertyMap;
- typedef std::map<const int, std::vector<unsigned char> > RawDataMap;
+ typedef std::map<const int, scoped_refptr<RefCountedMemory> > RawDataMap;
typedef std::map<const int, std::string> ResourceNameMap;
// Returns the string key for the given tint |id| TINT_* enum value.

Powered by Google App Engine
This is Rietveld 408576698