diff options
author | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-21 09:37:13 +0000 |
---|---|---|
committer | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-21 09:37:13 +0000 |
commit | 2b1d9f1e40a879897f13c0189757ebd135ade38b (patch) | |
tree | 4ebad79e51561460834cd65181c3940f3cc0d66d /chrome/browser/ui/webui/extension_icon_source.cc | |
parent | bd183ec2e20df5d2c18ace26cbb0c1c0ede1d70a (diff) | |
download | chromium_src-2b1d9f1e40a879897f13c0189757ebd135ade38b.zip chromium_src-2b1d9f1e40a879897f13c0189757ebd135ade38b.tar.gz chromium_src-2b1d9f1e40a879897f13c0189757ebd135ade38b.tar.bz2 |
Added RefCountedString, as this is what many RefCountedMemory users seem to want
Made data member of RefCountedBytes private, as per style guide
Changed base64 APIs to accept StringPiece, as it's sometimes better and never worse than string.
BUG=None
TEST=All existing tests pass. Extended ref_counted_memory_unittests
Review URL: http://codereview.chromium.org/7397021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93365 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/webui/extension_icon_source.cc')
-rw-r--r-- | chrome/browser/ui/webui/extension_icon_source.cc | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/chrome/browser/ui/webui/extension_icon_source.cc b/chrome/browser/ui/webui/extension_icon_source.cc index b38c273..78c7b27 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; } |