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

Unified Diff: ui/gfx/image/image_skia.h

Issue 10828296: Avoid crashing when an ImageSkia has no representations and is converted to SkBitmap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add test Created 8 years, 4 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 | ui/gfx/image/image_skia.cc » ('j') | ui/gfx/image/image_skia_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/image/image_skia.h
diff --git a/ui/gfx/image/image_skia.h b/ui/gfx/image/image_skia.h
index fffae7a54d0ca4c748fca8af5f222c5721cb59aa..38e6e7a57f674dba44ba47a1785abc07ec40ee40 100644
--- a/ui/gfx/image/image_skia.h
+++ b/ui/gfx/image/image_skia.h
@@ -113,7 +113,7 @@ class UI_EXPORT ImageSkia {
// This function should only be used in unittests and on platforms which do
// not support scale factors other than 1x.
// TODO(pkotwicz): Return null SkBitmap when the object has no 1x bitmap.
- const SkBitmap* bitmap() const;
+ const SkBitmap* bitmap() const { return &operator SkBitmap&(); }
pkotwicz 2012/08/14 14:44:24 Can you actually make the operator use ImageSkia::
Jeffrey Yasskin 2012/08/14 17:08:28 This is the direction that makes const-ness work.
// Returns a vector with the image reps contained in this object.
// There is no guarantee that this will return all images rep for
« no previous file with comments | « no previous file | ui/gfx/image/image_skia.cc » ('j') | ui/gfx/image/image_skia_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698