-
Nico Weber authored
NSNumber literals, expression literals, container literals: e.g. in base/mac/foundation_util.mm (expression literal), base/mac/foundation_util_unittests.mm (NSNumber literal, container literal). This is a compiler feature and we have used it for years. https://clang.llvm.org/docs/ObjectiveCLiterals.html @implementation instance variables, in translate_bubble_controller.h (note that ivars referred to in the _unittest.mm need to stay in the .h). This requires the "modern runtime". We could use this once we we shipped 64-bit chrome (m39, late 2014). NSDictionary and NSArray subscripting, e.g. in service_process_util_mac.mm. Note that for scoped_nsobject<NSArray>, you need to do ptr.get()[index]. (We could probably return a proxy object from scoped_nsobject::operator[] to make that unnecessary, but that feels like it might be too clever.) Custom @interfaces can add their own support for subscripting. This has worked since the 10.8 SDK. Generics, e.g. in translate_bubble_controller.h: NSDictionary<NSNumber*, NSView*> instead of just NSDictionary. This works only since the 10.11 SDK, and the bots had an older SDK until erikchen's 10.12 SDK work completed late last year. https://developer.apple.com/videos/play/wwdc2012/405/, click "slides", auth See also https://developer.apple.com/library/content/releasenotes/ObjectiveC/ObjCAvailabilityIndex/index.html We don't use property auto-synthesis because it's very magical. We build with -Wobjc-missing-property-synthesis to make sure the compiler informs us if we forget to synthesize a property in some way. We don't use arc. Bug: 324079 Change-Id: I78659ed47829fe73c2b87cce43a83ec36deb87e8 Reviewed-on: https://chromium-review.googlesource.com/884011 Commit-Queue: Nico Weber <thakis@chromium.org> Reviewed-by:
Elly Fong-Jones <ellyjones@chromium.org> Reviewed-by:
Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/master@{#531990}
ba12dcb8