Commit 8f8fd9b0 authored by Justin Cohen's avatar Justin Cohen Committed by Commit Bot

[ios] Suppress DCHECK from Xcode10 jpg asset catalog bug.

Asset catalogs fail for jpg imagesets with the iOS 12 SDK running with iOS 11.

See rdar://41088480

Bug: 852431
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: Ibec667c21ec0abec5e0e1da2b1e7b81b2aabdb0b
Reviewed-on: https://chromium-review.googlesource.com/1099144
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566963}
parent ab5657b7
...@@ -19,6 +19,9 @@ BASE_EXPORT bool IsRunningOnIOS10OrLater(); ...@@ -19,6 +19,9 @@ BASE_EXPORT bool IsRunningOnIOS10OrLater();
// Returns whether the operating system is iOS 11 or later. // Returns whether the operating system is iOS 11 or later.
BASE_EXPORT bool IsRunningOnIOS11OrLater(); BASE_EXPORT bool IsRunningOnIOS11OrLater();
// Returns whether the operating system is iOS 12 or later.
BASE_EXPORT bool IsRunningOnIOS12OrLater();
// Returns whether the operating system is at the given version or later. // Returns whether the operating system is at the given version or later.
BASE_EXPORT bool IsRunningOnOrLater(int32_t major, BASE_EXPORT bool IsRunningOnOrLater(int32_t major,
int32_t minor, int32_t minor,
......
...@@ -38,6 +38,11 @@ bool IsRunningOnIOS11OrLater() { ...@@ -38,6 +38,11 @@ bool IsRunningOnIOS11OrLater() {
return is_running_on_or_later; return is_running_on_or_later;
} }
bool IsRunningOnIOS12OrLater() {
static const bool is_running_on_or_later = IsRunningOnOrLater(12, 0, 0);
return is_running_on_or_later;
}
bool IsRunningOnOrLater(int32_t major, int32_t minor, int32_t bug_fix) { bool IsRunningOnOrLater(int32_t major, int32_t minor, int32_t bug_fix) {
static const int32_t* current_version = OSVersionAsArray(); static const int32_t* current_version = OSVersionAsArray();
int32_t version[] = {major, minor, bug_fix}; int32_t version[] = {major, minor, bug_fix};
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <objc/runtime.h> #include <objc/runtime.h>
#include "base/ios/ios_util.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "components/crash/core/common/objc_zombie.h" #include "components/crash/core/common/objc_zombie.h"
...@@ -36,6 +37,13 @@ void swizzleUIImageImageNamed() { ...@@ -36,6 +37,13 @@ void swizzleUIImageImageNamed() {
[whiteList addObject:@"voice_icon_keyboard_accessory"]; [whiteList addObject:@"voice_icon_keyboard_accessory"];
[whiteList addObject:@"voice_icon"]; [whiteList addObject:@"voice_icon"];
#if defined(__IPHONE_12_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_12_0)
// TODO(crbug.com/852431): radar://41088480 Asset catalogs fail for jpg
// imagesets with the iOS 12 SDK running with iOS 11. whiteList these for now.
if (!base::ios::IsRunningOnIOS12OrLater())
[whiteList addObject:@"stack_view_background_noise"];
#endif
// The original implementation of [UIImage imageNamed:]. // The original implementation of [UIImage imageNamed:].
// Called by the new implementation. // Called by the new implementation.
static IMP originalImp; static IMP originalImp;
......
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