Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Issue 2543703002: [Mac] Switch from NSObject categories to forward declarations for Touch Bar support. (Closed)

Created:
4 years ago by Sidney San Martín
Modified:
4 years ago
Reviewers:
tapted
CC:
chromium-reviews, tfarina, mac-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Mac] Switch from NSObject categories to forward declarations for Touch Bar support. This fixes a crash when -[BridgedContentView touchBar:] calls -[NSGroupTouchBarItem groupItemWithIdentifier:items:], because NSGroupTouchBarItem was typedef'd to NSObject. This is an improved version of https://crrev.com/799f1635ddedf7fd2f69f7dca26b0f2bf6399cba BUG=666893 Committed: https://crrev.com/3a6a6c13fe021aa3124ecaadf4655aa76ce47a99 Cr-Commit-Position: refs/heads/master@{#435477}

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+70 lines, -18 lines) Patch
M ui/base/cocoa/touch_bar_forward_declarations.h View 1 chunk +67 lines, -17 lines 3 comments Download
M ui/views/cocoa/bridged_content_view_touch_bar.mm View 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 16 (10 generated)
Sidney San Martín
Tested this against our hermetic toolchain and the 10.12 SDK.
4 years ago (2016-11-30 20:03:47 UTC) #7
tapted
lgtm - Thanks! A couple of concerns but maybe we just need to start smoking ...
4 years ago (2016-11-30 23:29:27 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2543703002/1
4 years ago (2016-11-30 23:31:26 UTC) #10
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years ago (2016-11-30 23:37:09 UTC) #13
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/3a6a6c13fe021aa3124ecaadf4655aa76ce47a99 Cr-Commit-Position: refs/heads/master@{#435477}
4 years ago (2016-11-30 23:39:28 UTC) #15
Sidney San Martín
4 years ago (2016-12-01 00:25:13 UTC) #16
Message was sent while issue was closed.
On 2016/11/30 23:29:27, tapted wrote:
> lgtm - Thanks!  A couple of concerns but maybe we just need to start smoking
out
> these older bots.. hopefully they are all happy with this
> 
>
https://codereview.chromium.org/2543703002/diff/1/ui/base/cocoa/touch_bar_for...
> File ui/base/cocoa/touch_bar_forward_declarations.h (right):
> 
>
https://codereview.chromium.org/2543703002/diff/1/ui/base/cocoa/touch_bar_for...
> ui/base/cocoa/touch_bar_forward_declarations.h:14: #pragma clang
assume_nonnull
> begin
> I think this is OK since we're replicating a system header and want to reduce
> the likelihood that we let stuff through the CQ that will break when compiling
> against the authentic 10.12.1 SDK  (but if you're curious there's some active
> discussion around whether we should use audited regions like this for new code
> at http://go/uzjld  )

Interesting discussion, thanks for the link!

>
https://codereview.chromium.org/2543703002/diff/1/ui/base/cocoa/touch_bar_for...
> ui/base/cocoa/touch_bar_forward_declarations.h:29: - (instancetype)init
> NS_DESIGNATED_INITIALIZER;
> Internet suggests NS_DESIGNATED_INITIALIZER is XCode 6, but I'm not sure on
the
> SDK. https://www.chromium.org/developers/design-documents/mac-xib-files
suggests
> we still use XCode 5 in some places. But I _think_ this is OK now.
> NS_DESIGNATED_INITIALIZER is used a lot on a lot of ios code, but
> image_capture_device_manager_unittest.mm is the only occurence I could find
for
> MacOS code. (and it looks like official builders are happy with that).
> 
> My 10.10 SDK's NSObjCRuntime.h has this defined in any case.
> 
>
https://codereview.chromium.org/2543703002/diff/1/ui/base/cocoa/touch_bar_for...
> ui/base/cocoa/touch_bar_forward_declarations.h:43: - (nullable __kindof
> NSTouchBarItem*)itemForIdentifier:
> I think __kindof is Xcode 7 (10.11 SDK). But hopefully this is a compiler
> intrinsic so isn't dependent on the SDK we link against. (i.e. the 10.10 SDK
> won't have any generics and might get confused :/)

Fingers crossed :/ ?

Powered by Google App Engine
This is Rietveld 408576698