Skip to content

Commit

Permalink
Changes behavior of iOS-specific gfx::Image constructor.
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
stkhapugin authored and Commit bot committed Dec 13, 2016
1 parent 6f5262d commit 2a1f622
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ui/gfx/image/image.cc
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ Image::Image(const ImageSkia& image) {
}

#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)
: storage_(new internal::ImageStorage(Image::kImageRepCocoaTouch)) {
Expand Down
2 changes: 1 addition & 1 deletion ui/gfx/image/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class GFX_EXPORT Image {
explicit Image(const ImageSkia& image);

#if defined(OS_IOS)
// Does not retain |image|; expects to take ownership.
// Retains |image|.
explicit Image(UIImage* image);

// Retains argument according to |policy|.
Expand Down

0 comments on commit 2a1f622

Please sign in to comment.