Index: extensions/browser/extension_icon_image.cc |
diff --git a/extensions/browser/extension_icon_image.cc b/extensions/browser/extension_icon_image.cc |
index 5ebc40017920f6190631bb21baf4fb5030308d28..667ef763a66aa288e9e141f918c6297c94d4e12c 100644 |
--- a/extensions/browser/extension_icon_image.cc |
+++ b/extensions/browser/extension_icon_image.cc |
@@ -223,8 +223,16 @@ void IconImage::OnImageLoaded(float scale, const gfx::Image& image_in) { |
DCHECK(!rep.is_null()); |
DCHECK_EQ(scale, rep.scale()); |
- // Remove old representation if there is one. |
- image_skia_.RemoveRepresentation(scale); |
+ // Remove all old representations. This will ensure that stale image caches |
+ // are invalidated. |
+ // TODO(oshima) |
+ // A better approach might be to set the |image_| member using the ImageSkia |
+ // copy from the image passed in and set the |image_skia_| member using |
+ // image_.ToImageSkia(). However that does not work correctly as the |
+ // ImageSkia from the image does not contain a source which breaks requests |
+ // for scaled images. |
+ image_skia_ = gfx::ImageSkia(); |
pkotwicz
2015/03/24 21:43:08
Drive by: Why don't you use the ImageSkia construc
ananta
2015/03/24 21:50:38
Please take a peek at the updated patch. We cannot
|
+ |
image_skia_.AddRepresentation(rep); |
// Update the image to use the updated image skia. |