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

Unified Diff: chrome/browser/favicon/favicon_service.cc

Issue 531493002: Move encoding SkBitmaps to PNG out of FaviconService::SetFavicons() and onto the history thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/history/android/android_provider_backend_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/favicon/favicon_service.cc
diff --git a/chrome/browser/favicon/favicon_service.cc b/chrome/browser/favicon/favicon_service.cc
index 47ffc9468148db9c9b29612ef3e1c00252d03e3d..829f8be6629d69d916e8b2c4ac7ad03f93a76c69 100644
--- a/chrome/browser/favicon/favicon_service.cc
+++ b/chrome/browser/favicon/favicon_service.cc
@@ -311,32 +311,18 @@ void FaviconService::SetFavicons(const GURL& page_url,
gfx::ImageSkia image_skia = image.AsImageSkia();
image_skia.EnsureRepsForSupportedScales();
const std::vector<gfx::ImageSkiaRep>& image_reps = image_skia.image_reps();
- std::vector<favicon_base::FaviconRawBitmapData> favicon_bitmap_data;
+ std::vector<SkBitmap> bitmaps;
const std::vector<float> favicon_scales = favicon_base::GetFaviconScales();
for (size_t i = 0; i < image_reps.size(); ++i) {
- // Don't save if the scale isn't one of supported favicon scale.
+ // Don't save if the scale isn't one of supported favicon scales.
if (std::find(favicon_scales.begin(),
favicon_scales.end(),
image_reps[i].scale()) == favicon_scales.end()) {
continue;
}
-
- scoped_refptr<base::RefCountedBytes> bitmap_data(
- new base::RefCountedBytes());
- if (gfx::PNGCodec::EncodeBGRASkBitmap(image_reps[i].sk_bitmap(),
- false,
- &bitmap_data->data())) {
- gfx::Size pixel_size(image_reps[i].pixel_width(),
- image_reps[i].pixel_height());
- favicon_base::FaviconRawBitmapData bitmap_data_element;
- bitmap_data_element.bitmap_data = bitmap_data;
- bitmap_data_element.pixel_size = pixel_size;
- bitmap_data_element.icon_url = icon_url;
-
- favicon_bitmap_data.push_back(bitmap_data_element);
- }
+ bitmaps.push_back(image_reps[i].sk_bitmap());
}
- history_service_->SetFavicons(page_url, icon_type, favicon_bitmap_data);
+ history_service_->SetFavicons(page_url, icon_type, icon_url, bitmaps);
}
void FaviconService::UnableToDownloadFavicon(const GURL& icon_url) {
« no previous file with comments | « no previous file | chrome/browser/history/android/android_provider_backend_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698