Description[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
Committed: https://crrev.com/fd625125b8a6a3aceaf09993a5f74cfe5368b17f
Cr-Commit-Position: refs/heads/master@{#400132}
Patch Set 1 #Patch Set 2 : Revert changes to build/config/compiler/BUILD.gn #
Total comments: 8
Patch Set 3 : Use ns_consumed #Patch Set 4 : Use macro to override default policy #Patch Set 5 : Remove explicit and undef DEFAULT_OWNERSHIP_POLICY #Patch Set 6 : Fix compilation on iOS #Patch Set 7 : Enable bind_objc_block_arc.mm tests #Patch Set 8 : Fix components build #Patch Set 9 : Remove macro and instead provide different constructor/reset implementation #Patch Set 10 : Remove macro and instead provide different constructor/reset implementation #Patch Set 11 : Fix unit tests && rebase #Patch Set 12 : Add missing copy constructor from scoped_nsobject<subclass> to scoped_nsobject<class> #
Messages
Total messages: 29 (12 generated)
|