Index: ui/gfx/image/image.cc |
diff --git a/ui/gfx/image/image.cc b/ui/gfx/image/image.cc |
index d7c67ccd65a7274d3ce6865aba7e4284d5c22b8c..7916fb4600b870b4eb5d43762ccfc786f5dca83f 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, false) {} |
sdefresne
2016/12/06 10:54:11
Image::Image(UIImage* image) : Image(image, base::
stkhapugin
2016/12/06 12:10:56
Done.
|
+ |
+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) { |