commit | fd625125b8a6a3aceaf09993a5f74cfe5368b17f | [log] [tgz] |
---|---|---|
author | sdefresne <[email protected]> | Thu Jun 16 11:51:08 2016 |
committer | Commit bot <[email protected]> | Thu Jun 16 11:52:52 2016 |
tree | 773bb773cca3188eeb3eb28ccfce83d51e4ecd10 | |
parent | 2b3eed5138ac8c58fbdcc420d6e26a5353e7820d [diff] |
[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}