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 b38c273c60354130b999e3dd44629ab7b0e8972d..78c7b27b8f8889f3e86cccd4b6de25549d54f9bf 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; |
} |