Commit 9eda1f82 authored by Avi Drissman's avatar Avi Drissman Committed by Commit Bot

Crash if a reasonable assumption turns out to fail.

System-provided objects that implement MTLDevice should derive from
NSObject. It would be silly if they didn't, given that the MTLDevice
protocol inherits from the NSObject protocol. However, if for some
reason this turns out to no longer be true in some future macOS, crash
early so that it's obvious what's wrong.

Bug: 1065146
Tbr: ccameron@chromium.org
Change-Id: I9c59d57c9a4e18ad1b6860971bfb27a731eb9140
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2129031Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarMark Mentovai <mark@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#754941}
parent d11e0f6a
......@@ -253,7 +253,7 @@ class API_AVAILABLE(macos(10.11)) MTLLibraryCache {
// Technically, _device is of protocol MTLDevice which inherits from protocol
// NSObject, and protocol NSObject does not have -methodSignatureForSelector:.
// Assume that the implementing class derives from NSObject.
return [base::mac::ObjCCast<NSObject>(_device)
return [base::mac::ObjCCastStrict<NSObject>(_device)
methodSignatureForSelector:selector];
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment