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

Unified Diff: chrome/browser/ui/webui/extension_icon_source.cc

Issue 7397021: Re-land r93365 - add RefCountedString (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: erg comments Created 9 years, 5 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/ui/webui/extension_icon_source.cc
diff --git a/chrome/browser/ui/webui/extension_icon_source.cc b/chrome/browser/ui/webui/extension_icon_source.cc
index 1b2168466fc62902200b60c3897d6edc86eebc86..785220ae79b83e8f6710bf00a02a30289d10b3be 100644
--- a/chrome/browser/ui/webui/extension_icon_source.cc
+++ b/chrome/browser/ui/webui/extension_icon_source.cc
@@ -31,12 +31,8 @@
namespace {
scoped_refptr<RefCountedMemory> BitmapToMemory(SkBitmap* image) {
- std::vector<unsigned char> output;
- gfx::PNGCodec::EncodeBGRASkBitmap(*image, false, &output);
-
- scoped_refptr<RefCountedBytes> image_bytes(new RefCountedBytes);
- image_bytes->data.resize(output.size());
- std::copy(output.begin(), output.end(), image_bytes->data.begin());
+ RefCountedBytes* image_bytes = new RefCountedBytes;
+ gfx::PNGCodec::EncodeBGRASkBitmap(*image, false, image_bytes->data());
return image_bytes;
}

Powered by Google App Engine
This is Rietveld 408576698