Index: ui/gfx/image/image.cc |
diff --git a/ui/gfx/image/image.cc b/ui/gfx/image/image.cc |
index d7c67ccd65a7274d3ce6865aba7e4284d5c22b8c..e3bcefcea217b644f8d2dda379b99cce31f89bce 100644 |
--- a/ui/gfx/image/image.cc |
+++ b/ui/gfx/image/image.cc |
@@ -420,10 +420,15 @@ Image::Image(const ImageSkia& image) { |
} |
#if defined(OS_IOS) |
-Image::Image(UIImage* image) |
+Image::Image(UIImage* image) : Image(image, base::scoped_policy::ASSUME) {} |
+ |
+Image::Image(UIImage* image, base::scoped_policy::OwnershipPolicy policy) |
: storage_(new internal::ImageStorage(Image::kImageRepCocoaTouch)) { |
- if (image) |
+ if (image) { |
+ if (policy == base::scoped_policy::RETAIN) |
+ base::mac::NSObjectRetain(image); |
AddRepresentation(base::MakeUnique<internal::ImageRepCocoaTouch>(image)); |
+ } |
} |
#elif defined(OS_MACOSX) |
Image::Image(NSImage* image) { |