Commit 2a1f622d authored by stkhapugin's avatar stkhapugin Committed by Commit bot

Changes behavior of iOS-specific gfx::Image constructor.

Chrome iOS is moving to Objective-C Automatic Reference Counting. Under
it, arguments are supposed to be autoreleased. This CL changes the constructor to retain its argument..
This is a part of a multiple CL setup that will change the Image(UIImage*) constructor from consuming +1 refcount to retaining the argument.

TEST=none
BUG=645125

Review-Url: https://codereview.chromium.org/2500373004
Cr-Commit-Position: refs/heads/master@{#438223}
parent 6f5262dd
...@@ -420,7 +420,7 @@ Image::Image(const ImageSkia& image) { ...@@ -420,7 +420,7 @@ Image::Image(const ImageSkia& image) {
} }
#if defined(OS_IOS) #if defined(OS_IOS)
Image::Image(UIImage* image) : Image(image, base::scoped_policy::ASSUME) {} Image::Image(UIImage* image) : Image(image, base::scoped_policy::RETAIN) {}
Image::Image(UIImage* image, base::scoped_policy::OwnershipPolicy policy) Image::Image(UIImage* image, base::scoped_policy::OwnershipPolicy policy)
: storage_(new internal::ImageStorage(Image::kImageRepCocoaTouch)) { : storage_(new internal::ImageStorage(Image::kImageRepCocoaTouch)) {
......
...@@ -71,7 +71,7 @@ class GFX_EXPORT Image { ...@@ -71,7 +71,7 @@ class GFX_EXPORT Image {
explicit Image(const ImageSkia& image); explicit Image(const ImageSkia& image);
#if defined(OS_IOS) #if defined(OS_IOS)
// Does not retain |image|; expects to take ownership. // Retains |image|.
explicit Image(UIImage* image); explicit Image(UIImage* image);
// Retains argument according to |policy|. // Retains argument according to |policy|.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment