New issue
Advanced search Search tips

Issue 599992 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: iOS , Mac
Pri: 3
Type: Bug



Sign in to add a comment

Allow base::scoped_nsobject<> to be used when ARC is enabled. Owner

Project Member Reported by sdefresne@chromium.org, Apr 1 2016

Issue description

This would allow build some files using ARC.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 16 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fd625125b8a6a3aceaf09993a5f74cfe5368b17f

commit fd625125b8a6a3aceaf09993a5f74cfe5368b17f
Author: sdefresne <sdefresne@chromium.org>
Date: Thu Jun 16 11:51:08 2016

[iOS/OS X] Allow base::scoped_nsobject<> to be used when ARC is enabled.

Add annotations (http://clang-analyzer.llvm.org/annotations.html) to
prevent clang from mucking with the objects reference count while
generating base::scoped_nsobject<> code when Automatic Reference
Counting (a.k.a. ARC) is enabled.

Use static function to perform explicit reference counting without
causing compilation errors when the file is included from a source
file with ARC enabled.

When using ARC, base::scoped_nsobject<> constructor and reset() method
have a different signature that does not allow passing the policy and
default to base::scoped_policy::RETAIN (this cause no visible change as
ARC insert a call to release). The ns_consumed annotation is supposed
to inform ARC not to insert that call, but does not work (see upstream
issue https://llvm.org/bugs/show_bug.cgi?id=27887).

Design document:
https://docs.google.com/document/d/1dEZ-pdHP6Q32yffHtrQjeUDGAD1MuPGaGOrMfdi1ihk/edit#

BUG= 599992 

Review-Url: https://codereview.chromium.org/1855483004
Cr-Commit-Position: refs/heads/master@{#400132}

[modify] https://crrev.com/fd625125b8a6a3aceaf09993a5f74cfe5368b17f/base/BUILD.gn
[modify] https://crrev.com/fd625125b8a6a3aceaf09993a5f74cfe5368b17f/base/base.gyp
[modify] https://crrev.com/fd625125b8a6a3aceaf09993a5f74cfe5368b17f/base/base.gypi
[modify] https://crrev.com/fd625125b8a6a3aceaf09993a5f74cfe5368b17f/base/mac/bind_objc_block.h
[modify] https://crrev.com/fd625125b8a6a3aceaf09993a5f74cfe5368b17f/base/mac/bind_objc_block_unittest.mm
[add] https://crrev.com/fd625125b8a6a3aceaf09993a5f74cfe5368b17f/base/mac/bind_objc_block_unittest_arc.mm
[modify] https://crrev.com/fd625125b8a6a3aceaf09993a5f74cfe5368b17f/base/mac/scoped_block.h
[modify] https://crrev.com/fd625125b8a6a3aceaf09993a5f74cfe5368b17f/base/mac/scoped_nsobject.h
[add] https://crrev.com/fd625125b8a6a3aceaf09993a5f74cfe5368b17f/base/mac/scoped_nsobject.mm
[modify] https://crrev.com/fd625125b8a6a3aceaf09993a5f74cfe5368b17f/base/mac/scoped_nsobject_unittest.mm
[add] https://crrev.com/fd625125b8a6a3aceaf09993a5f74cfe5368b17f/base/mac/scoped_nsobject_unittest_arc.mm
[modify] https://crrev.com/fd625125b8a6a3aceaf09993a5f74cfe5368b17f/base/mac/scoped_typeref.h

Status: Fixed (was: Assigned)

Sign in to add a comment