Commit 780e443e authored by Avi Drissman's avatar Avi Drissman Committed by Commit Bot

Update core items for macOS Big Sur.

- Update the base::mac::IsOS*() functions. Introduce a parallel set
  of IsOS#() functions to match the IsOS10_#() functions. Update all
  tests to match, and update callers where appropriate.
- Turn on the CFAllocator OOM killer for Big Sur, as the
  internals of CFAllocator have not changed.

BUG=45650, 1101439
TEST=base_unittests

Change-Id: I57438eb025316e3cb899a0fa5aef35f4d297855f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2285930Reviewed-by: default avatarMark Mentovai <mark@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791051}
parent 8fbee970
...@@ -216,7 +216,7 @@ bool CanGetContextForCFAllocator() { ...@@ -216,7 +216,7 @@ bool CanGetContextForCFAllocator() {
#if defined(OS_IOS) #if defined(OS_IOS)
return !base::ios::IsRunningOnOrLater(14, 0, 0); return !base::ios::IsRunningOnOrLater(14, 0, 0);
#else #else
return !base::mac::IsOSLaterThan10_15_DontCallThis(); return !base::mac::IsOSLaterThan11_DontCallThis();
#endif #endif
} }
......
...@@ -5,10 +5,11 @@ ...@@ -5,10 +5,11 @@
#ifndef BASE_MAC_MAC_UTIL_H_ #ifndef BASE_MAC_MAC_UTIL_H_
#define BASE_MAC_MAC_UTIL_H_ #define BASE_MAC_MAC_UTIL_H_
#include <AvailabilityMacros.h>
#import <CoreGraphics/CoreGraphics.h>
#include <stdint.h> #include <stdint.h>
#include <string>
#import <CoreGraphics/CoreGraphics.h> #include <string>
#include "base/base_export.h" #include "base/base_export.h"
...@@ -73,9 +74,11 @@ BASE_EXPORT bool RemoveQuarantineAttribute(const FilePath& file_path); ...@@ -73,9 +74,11 @@ BASE_EXPORT bool RemoveQuarantineAttribute(const FilePath& file_path);
namespace internal { namespace internal {
// Returns the system's Mac OS X minor version. This is the |y| value // Returns the system's macOS major and minor version numbers combined into an
// in 10.y or 10.y.z. // integer value. For example, for macOS Sierra this returns 1012, and for macOS
BASE_EXPORT int MacOSXMinorVersion(); // Big Sur it returns 1100. Note that the accuracy returned by this function is
// as granular as the major version number of Darwin.
BASE_EXPORT int MacOSVersion();
} // namespace internal } // namespace internal
...@@ -85,63 +88,96 @@ BASE_EXPORT int MacOSXMinorVersion(); ...@@ -85,63 +88,96 @@ BASE_EXPORT int MacOSXMinorVersion();
// "AtMost" variants to those that check for a specific version, unless you know // "AtMost" variants to those that check for a specific version, unless you know
// for sure that you need to check for a specific version. // for sure that you need to check for a specific version.
#define DEFINE_IS_OS_FUNCS_CR_MIN_REQUIRED(V, TEST_DEPLOYMENT_TARGET) \ #define DEFINE_OLD_IS_OS_FUNCS_CR_MIN_REQUIRED(V, DEPLOYMENT_TARGET_TEST) \
inline bool IsOS10_##V() { \ inline bool IsOS10_##V() { \
TEST_DEPLOYMENT_TARGET(>, V, false) \ DEPLOYMENT_TARGET_TEST(>, V, false) \
return internal::MacOSXMinorVersion() == V; \ return internal::MacOSVersion() == 1000 + V; \
} \
inline bool IsAtMostOS10_##V() { \
DEPLOYMENT_TARGET_TEST(>, V, false) \
return internal::MacOSVersion() <= 1000 + V; \
}
#define DEFINE_OLD_IS_OS_FUNCS(V, DEPLOYMENT_TARGET_TEST) \
DEFINE_OLD_IS_OS_FUNCS_CR_MIN_REQUIRED(V, DEPLOYMENT_TARGET_TEST) \
inline bool IsAtLeastOS10_##V() { \
DEPLOYMENT_TARGET_TEST(>=, V, true) \
return internal::MacOSVersion() >= 1000 + V; \
}
// TODO(https://crbug.com/1105187): Update MAC_OS_X_VERSION_MIN_REQUIRED to
// whatever macro it turns into in the future.
#define DEFINE_IS_OS_FUNCS_CR_MIN_REQUIRED(V, DEPLOYMENT_TARGET_TEST) \
inline bool IsOS##V() { \
DEPLOYMENT_TARGET_TEST(>, V, false) \
return internal::MacOSVersion() == V * 100; \
} \ } \
inline bool IsAtMostOS10_##V() { \ inline bool IsAtMostOS##V() { \
TEST_DEPLOYMENT_TARGET(>, V, false) \ DEPLOYMENT_TARGET_TEST(>, V, false) \
return internal::MacOSXMinorVersion() <= V; \ return internal::MacOSVersion() <= V * 100; \
} }
#define DEFINE_IS_OS_FUNCS(V, TEST_DEPLOYMENT_TARGET) \ #define DEFINE_IS_OS_FUNCS(V, DEPLOYMENT_TARGET_TEST) \
DEFINE_IS_OS_FUNCS_CR_MIN_REQUIRED(V, TEST_DEPLOYMENT_TARGET) \ DEFINE_IS_OS_FUNCS_CR_MIN_REQUIRED(V, DEPLOYMENT_TARGET_TEST) \
inline bool IsAtLeastOS10_##V() { \ inline bool IsAtLeastOS##V() { \
TEST_DEPLOYMENT_TARGET(>=, V, true) \ DEPLOYMENT_TARGET_TEST(>=, V, true) \
return internal::MacOSXMinorVersion() >= V; \ return internal::MacOSVersion() >= V * 100; \
} }
#define TEST_DEPLOYMENT_TARGET(OP, V, RET) \ #define OLD_TEST_DEPLOYMENT_TARGET(OP, V, RET) \
if (MAC_OS_X_VERSION_MIN_REQUIRED OP MAC_OS_X_VERSION_10_##V) \ if (MAC_OS_X_VERSION_MIN_REQUIRED OP MAC_OS_X_VERSION_10_##V) \
return RET; return RET;
#define TEST_DEPLOYMENT_TARGET(OP, V, RET) \
if (MAC_OS_X_VERSION_MIN_REQUIRED OP MAC_OS_VERSION_##V##_0) \
return RET;
#define IGNORE_DEPLOYMENT_TARGET(OP, V, RET) #define IGNORE_DEPLOYMENT_TARGET(OP, V, RET)
// Notes: // Notes:
// - When bumping the minimum version of the macOS required by Chromium, remove // - When bumping the minimum version of the macOS required by Chromium, remove
// lines from below corresponding to versions of the macOS no longer // lines from below corresponding to versions of the macOS no longer
// supported. Ensure that the minimum supported version uses the // supported. Ensure that the minimum supported version uses the
// DEFINE_IS_OS_FUNCS_CR_MIN_REQUIRED macro. // DEFINE_OLD_IS_OS_FUNCS_CR_MIN_REQUIRED macro. When macOS 11.0 is the
// minimum required version, remove all the OLD versions of the macros.
// - When bumping the minimum version of the macOS SDK required to build // - When bumping the minimum version of the macOS SDK required to build
// Chromium, remove the #ifdef that switches between TEST_DEPLOYMENT_TARGET // Chromium, remove the #ifdef that switches between
// and IGNORE_DEPLOYMENT_TARGET. // TEST_DEPLOYMENT_TARGET and IGNORE_DEPLOYMENT_TARGET.
// Versions of macOS supported at runtime but whose SDK is not supported for // Versions of macOS supported at runtime but whose SDK is not supported for
// building. // building.
DEFINE_IS_OS_FUNCS_CR_MIN_REQUIRED(10, TEST_DEPLOYMENT_TARGET) DEFINE_OLD_IS_OS_FUNCS_CR_MIN_REQUIRED(10, OLD_TEST_DEPLOYMENT_TARGET)
DEFINE_IS_OS_FUNCS(11, TEST_DEPLOYMENT_TARGET) DEFINE_OLD_IS_OS_FUNCS(11, OLD_TEST_DEPLOYMENT_TARGET)
DEFINE_IS_OS_FUNCS(12, TEST_DEPLOYMENT_TARGET) DEFINE_OLD_IS_OS_FUNCS(12, OLD_TEST_DEPLOYMENT_TARGET)
DEFINE_IS_OS_FUNCS(13, TEST_DEPLOYMENT_TARGET) DEFINE_OLD_IS_OS_FUNCS(13, OLD_TEST_DEPLOYMENT_TARGET)
DEFINE_IS_OS_FUNCS(14, TEST_DEPLOYMENT_TARGET) DEFINE_OLD_IS_OS_FUNCS(14, OLD_TEST_DEPLOYMENT_TARGET)
// Versions of macOS supported at runtime and whose SDK is supported for // Versions of macOS supported at runtime and whose SDK is supported for
// building. // building.
#ifdef MAC_OS_X_VERSION_10_15 #ifdef MAC_OS_X_VERSION_10_15
DEFINE_IS_OS_FUNCS(15, TEST_DEPLOYMENT_TARGET) DEFINE_OLD_IS_OS_FUNCS(15, OLD_TEST_DEPLOYMENT_TARGET)
#else #else
DEFINE_IS_OS_FUNCS(15, IGNORE_DEPLOYMENT_TARGET) DEFINE_OLD_IS_OS_FUNCS(15, IGNORE_DEPLOYMENT_TARGET)
#endif #endif
#undef IGNORE_DEPLOYMENT_TARGET #ifdef MAC_OS_VERSION_11_0
#undef TEST_DEPLOYMENT_TARGET DEFINE_IS_OS_FUNCS(11, TEST_DEPLOYMENT_TARGET)
#else
DEFINE_IS_OS_FUNCS(11, IGNORE_DEPLOYMENT_TARGET)
#endif
#undef DEFINE_OLD_IS_OS_FUNCS_CR_MIN_REQUIRED
#undef DEFINE_OLD_IS_OS_FUNCS
#undef DEFINE_IS_OS_FUNCS_CR_MIN_REQUIRED #undef DEFINE_IS_OS_FUNCS_CR_MIN_REQUIRED
#undef DEFINE_IS_OS_FUNCS #undef DEFINE_IS_OS_FUNCS
#undef OLD_TEST_DEPLOYMENT_TARGET
#undef TEST_DEPLOYMENT_TARGET
#undef IGNORE_DEPLOYMENT_TARGET
// This should be infrequently used. It only makes sense to use this to avoid // This should be infrequently used. It only makes sense to use this to avoid
// codepaths that are very likely to break on future (unreleased, untested, // codepaths that are very likely to break on future (unreleased, untested,
// unborn) OS releases, or to log when the OS is newer than any known version. // unborn) OS releases, or to log when the OS is newer than any known version.
inline bool IsOSLaterThan10_15_DontCallThis() { inline bool IsOSLaterThan11_DontCallThis() {
return !IsAtMostOS10_15(); return !IsAtMostOS11();
} }
// Retrieve the system's model identifier string from the IOKit registry: // Retrieve the system's model identifier string from the IOKit registry:
......
...@@ -271,16 +271,16 @@ bool RemoveQuarantineAttribute(const FilePath& file_path) { ...@@ -271,16 +271,16 @@ bool RemoveQuarantineAttribute(const FilePath& file_path) {
namespace { namespace {
// Returns the running system's Darwin major version. Don't call this, it's // Returns the running system's Darwin major version. Don't call this, it's an
// an implementation detail and its result is meant to be cached by // implementation detail and its result is meant to be cached by
// MacOSXMinorVersion. // MacOSVersionInternal().
int DarwinMajorVersionInternal() { int DarwinMajorVersionInternal() {
// base::OperatingSystemVersionNumbers calls Gestalt, which is a // base::OperatingSystemVersionNumbers() at one time called Gestalt(), which
// higher-level operation than is needed. It might perform unnecessary // was observed to be able to spawn threads (see https://crbug.com/53200).
// operations. On 10.6, it was observed to be able to spawn threads (see // Nowadays that function calls -[NSProcessInfo operatingSystemVersion], whose
// http://crbug.com/53200). It might also read files or perform other // current implementation does things like hit the file system, which is
// blocking operations. Actually, nobody really knows for sure just what // possibly a blocking operation. Either way, it's overkill for what needs to
// Gestalt might do, or what it might be taught to do in the future. // be done here.
// //
// uname, on the other hand, is implemented as a simple series of sysctl // uname, on the other hand, is implemented as a simple series of sysctl
// system calls to obtain the relevant data from the kernel. The data is // system calls to obtain the relevant data from the kernel. The data is
...@@ -316,33 +316,38 @@ int DarwinMajorVersionInternal() { ...@@ -316,33 +316,38 @@ int DarwinMajorVersionInternal() {
return darwin_major_version; return darwin_major_version;
} }
// Returns the running system's Mac OS X minor version. This is the |y| value // The implementation of MacOSVersion() as defined in the header. Don't call
// in 10.y or 10.y.z. Don't call this, it's an implementation detail and the // this, it's an implementation detail and the result is meant to be cached by
// result is meant to be cached by MacOSXMinorVersion. // MacOSVersion().
int MacOSXMinorVersionInternal() { int MacOSVersionInternal() {
int darwin_major_version = DarwinMajorVersionInternal(); int darwin_major_version = DarwinMajorVersionInternal();
// The Darwin major version is always 4 greater than the Mac OS X minor // Darwin major versions 6 through 19 corresponded to macOS versions 10.2
// version for Darwin versions beginning with 6, corresponding to Mac OS X // through 10.15.
// 10.2. Since this correspondence may change in the future, warn when
// encountering a version higher than anything seen before. Older Darwin
// versions, or versions that can't be determined, result in immediate death.
CHECK(darwin_major_version >= 6); CHECK(darwin_major_version >= 6);
int mac_os_x_minor_version = darwin_major_version - 4; if (darwin_major_version <= 19)
DLOG_IF(WARNING, darwin_major_version > 19) return 1000 + darwin_major_version - 4;
// Darwin major version 20 corresponds to macOS version 11.0. Assume a
// correspondence between Darwin's major version numbers and macOS major
// version numbers.
int macos_major_version = darwin_major_version - 9;
DLOG_IF(WARNING, darwin_major_version > 20)
<< "Assuming Darwin " << base::NumberToString(darwin_major_version) << "Assuming Darwin " << base::NumberToString(darwin_major_version)
<< " is macOS 10." << base::NumberToString(mac_os_x_minor_version); << " is macOS " << base::NumberToString(macos_major_version);
return mac_os_x_minor_version; return macos_major_version * 100;
} }
} // namespace } // namespace
namespace internal { namespace internal {
int MacOSXMinorVersion() {
static int mac_os_x_minor_version = MacOSXMinorVersionInternal(); int MacOSVersion() {
return mac_os_x_minor_version; static int macos_version = MacOSVersionInternal();
return macos_version;
} }
} // namespace internal } // namespace internal
std::string GetModelIdentifier() { std::string GetModelIdentifier() {
......
...@@ -27,7 +27,7 @@ namespace mac { ...@@ -27,7 +27,7 @@ namespace mac {
namespace { namespace {
typedef PlatformTest MacUtilTest; using MacUtilTest = PlatformTest;
TEST_F(MacUtilTest, GetUserDirectoryTest) { TEST_F(MacUtilTest, GetUserDirectoryTest) {
// Try a few keys, make sure they come back with non-empty paths. // Try a few keys, make sure they come back with non-empty paths.
...@@ -143,100 +143,136 @@ TEST_F(MacUtilTest, IsOSEllipsis) { ...@@ -143,100 +143,136 @@ TEST_F(MacUtilTest, IsOSEllipsis) {
// - FALSE/TRUE/FALSE (it is not the later version, it is "at most" the later // - FALSE/TRUE/FALSE (it is not the later version, it is "at most" the later
// version, it is not "at least" the later version) // version, it is not "at least" the later version)
#define TEST_FOR_PAST_OS(V) \ #define TEST_FOR_PAST_10_OS(V) \
EXPECT_FALSE(IsOS10_##V()); \ EXPECT_FALSE(IsOS10_##V()); \
EXPECT_FALSE(IsAtMostOS10_##V()); \ EXPECT_FALSE(IsAtMostOS10_##V()); \
EXPECT_TRUE(IsAtLeastOS10_##V()); EXPECT_TRUE(IsAtLeastOS10_##V());
#define TEST_FOR_SAME_OS(V) \ #define TEST_FOR_PAST_OS(V) \
EXPECT_FALSE(IsOS##V()); \
EXPECT_FALSE(IsAtMostOS##V()); \
EXPECT_TRUE(IsAtLeastOS##V());
#define TEST_FOR_SAME_10_OS(V) \
EXPECT_TRUE(IsOS10_##V()); \ EXPECT_TRUE(IsOS10_##V()); \
EXPECT_TRUE(IsAtMostOS10_##V()); \ EXPECT_TRUE(IsAtMostOS10_##V()); \
EXPECT_TRUE(IsAtLeastOS10_##V()); EXPECT_TRUE(IsAtLeastOS10_##V());
#define TEST_FOR_FUTURE_OS(V) \ #define TEST_FOR_SAME_OS(V) \
EXPECT_TRUE(IsOS##V()); \
EXPECT_TRUE(IsAtMostOS##V()); \
EXPECT_TRUE(IsAtLeastOS##V());
#define TEST_FOR_FUTURE_10_OS(V) \
EXPECT_FALSE(IsOS10_##V()); \ EXPECT_FALSE(IsOS10_##V()); \
EXPECT_TRUE(IsAtMostOS10_##V()); \ EXPECT_TRUE(IsAtMostOS10_##V()); \
EXPECT_FALSE(IsAtLeastOS10_##V()); EXPECT_FALSE(IsAtLeastOS10_##V());
#define TEST_FOR_FUTURE_OS(V) \
EXPECT_FALSE(IsOS##V()); \
EXPECT_TRUE(IsAtMostOS##V()); \
EXPECT_FALSE(IsAtLeastOS##V());
if (major == 10) { if (major == 10) {
if (minor == 10) { if (minor == 10) {
EXPECT_TRUE(IsOS10_10()); EXPECT_TRUE(IsOS10_10());
EXPECT_TRUE(IsAtMostOS10_10()); EXPECT_TRUE(IsAtMostOS10_10());
TEST_FOR_FUTURE_10_OS(11);
TEST_FOR_FUTURE_10_OS(12);
TEST_FOR_FUTURE_10_OS(13);
TEST_FOR_FUTURE_10_OS(14);
TEST_FOR_FUTURE_10_OS(15);
TEST_FOR_FUTURE_OS(11); TEST_FOR_FUTURE_OS(11);
TEST_FOR_FUTURE_OS(12);
TEST_FOR_FUTURE_OS(13);
TEST_FOR_FUTURE_OS(14);
TEST_FOR_FUTURE_OS(15);
EXPECT_FALSE(IsOSLaterThan10_15_DontCallThis()); EXPECT_FALSE(IsOSLaterThan11_DontCallThis());
} else if (minor == 11) { } else if (minor == 11) {
EXPECT_FALSE(IsOS10_10()); EXPECT_FALSE(IsOS10_10());
EXPECT_FALSE(IsAtMostOS10_10()); EXPECT_FALSE(IsAtMostOS10_10());
TEST_FOR_SAME_OS(11); TEST_FOR_SAME_10_OS(11);
TEST_FOR_FUTURE_OS(12); TEST_FOR_FUTURE_10_OS(12);
TEST_FOR_FUTURE_OS(13); TEST_FOR_FUTURE_10_OS(13);
TEST_FOR_FUTURE_OS(14); TEST_FOR_FUTURE_10_OS(14);
TEST_FOR_FUTURE_OS(15); TEST_FOR_FUTURE_10_OS(15);
TEST_FOR_FUTURE_OS(11);
EXPECT_FALSE(IsOSLaterThan10_15_DontCallThis()); EXPECT_FALSE(IsOSLaterThan11_DontCallThis());
} else if (minor == 12) { } else if (minor == 12) {
EXPECT_FALSE(IsOS10_10()); EXPECT_FALSE(IsOS10_10());
EXPECT_FALSE(IsAtMostOS10_10()); EXPECT_FALSE(IsAtMostOS10_10());
TEST_FOR_PAST_OS(11); TEST_FOR_PAST_10_OS(11);
TEST_FOR_SAME_OS(12); TEST_FOR_SAME_10_OS(12);
TEST_FOR_FUTURE_OS(13); TEST_FOR_FUTURE_10_OS(13);
TEST_FOR_FUTURE_OS(14); TEST_FOR_FUTURE_10_OS(14);
TEST_FOR_FUTURE_OS(15); TEST_FOR_FUTURE_10_OS(15);
TEST_FOR_FUTURE_OS(11);
EXPECT_FALSE(IsOSLaterThan10_15_DontCallThis()); EXPECT_FALSE(IsOSLaterThan11_DontCallThis());
} else if (minor == 13) { } else if (minor == 13) {
EXPECT_FALSE(IsOS10_10()); EXPECT_FALSE(IsOS10_10());
EXPECT_FALSE(IsAtMostOS10_10()); EXPECT_FALSE(IsAtMostOS10_10());
TEST_FOR_PAST_OS(11); TEST_FOR_PAST_10_OS(11);
TEST_FOR_PAST_OS(12); TEST_FOR_PAST_10_OS(12);
TEST_FOR_SAME_OS(13); TEST_FOR_SAME_10_OS(13);
TEST_FOR_FUTURE_OS(14); TEST_FOR_FUTURE_10_OS(14);
TEST_FOR_FUTURE_OS(15); TEST_FOR_FUTURE_10_OS(15);
TEST_FOR_FUTURE_OS(11);
EXPECT_FALSE(IsOSLaterThan10_15_DontCallThis()); EXPECT_FALSE(IsOSLaterThan11_DontCallThis());
} else if (minor == 14) { } else if (minor == 14) {
EXPECT_FALSE(IsOS10_10()); EXPECT_FALSE(IsOS10_10());
EXPECT_FALSE(IsAtMostOS10_10()); EXPECT_FALSE(IsAtMostOS10_10());
TEST_FOR_PAST_OS(11); TEST_FOR_PAST_10_OS(11);
TEST_FOR_PAST_OS(12); TEST_FOR_PAST_10_OS(12);
TEST_FOR_PAST_OS(13); TEST_FOR_PAST_10_OS(13);
TEST_FOR_SAME_OS(14); TEST_FOR_SAME_10_OS(14);
TEST_FOR_FUTURE_OS(15); TEST_FOR_FUTURE_10_OS(15);
TEST_FOR_FUTURE_OS(11);
EXPECT_FALSE(IsOSLaterThan10_15_DontCallThis()); EXPECT_FALSE(IsOSLaterThan11_DontCallThis());
} else if (minor == 15) { } else if (minor == 15) {
EXPECT_FALSE(IsOS10_10()); EXPECT_FALSE(IsOS10_10());
EXPECT_FALSE(IsAtMostOS10_10()); EXPECT_FALSE(IsAtMostOS10_10());
TEST_FOR_PAST_OS(11); TEST_FOR_PAST_10_OS(11);
TEST_FOR_PAST_OS(12); TEST_FOR_PAST_10_OS(12);
TEST_FOR_PAST_OS(13); TEST_FOR_PAST_10_OS(13);
TEST_FOR_PAST_OS(14); TEST_FOR_PAST_10_OS(14);
TEST_FOR_SAME_OS(15); TEST_FOR_SAME_10_OS(15);
TEST_FOR_FUTURE_OS(11);
EXPECT_FALSE(IsOSLaterThan10_15_DontCallThis()); EXPECT_FALSE(IsOSLaterThan11_DontCallThis());
} else { } else {
// Not ten, eleven, twelve, thirteen, fourteen, or fifteen. Ah, ah, ah. // macOS 10.15 was the end of the line.
EXPECT_TRUE(false); EXPECT_TRUE(false);
} }
} else if (major == 11) {
EXPECT_FALSE(IsOS10_10());
EXPECT_FALSE(IsAtMostOS10_10());
TEST_FOR_PAST_10_OS(11);
TEST_FOR_PAST_10_OS(12);
TEST_FOR_PAST_10_OS(13);
TEST_FOR_PAST_10_OS(14);
TEST_FOR_PAST_10_OS(15);
TEST_FOR_SAME_OS(11);
EXPECT_FALSE(IsOSLaterThan11_DontCallThis());
} else { } else {
// Not ten. What you gonna do? // The spooky future.
EXPECT_FALSE(true); EXPECT_FALSE(true);
} }
} }
#undef TEST_FOR_PAST_10_OS
#undef TEST_FOR_PAST_OS #undef TEST_FOR_PAST_OS
#undef TEST_FOR_SAME_10_OS
#undef TEST_FOR_SAME_OS #undef TEST_FOR_SAME_OS
#undef TEST_FOR_FUTURE_10_OS
#undef TEST_FOR_FUTURE_OS #undef TEST_FOR_FUTURE_OS
TEST_F(MacUtilTest, ParseModelIdentifier) { TEST_F(MacUtilTest, ParseModelIdentifier) {
......
...@@ -746,10 +746,10 @@ bool StackSamplingProfiler::IsSupported() { ...@@ -746,10 +746,10 @@ bool StackSamplingProfiler::IsSupported() {
(defined(OS_MACOSX) && defined(ARCH_CPU_X86_64) && !defined(OS_IOS)) || \ (defined(OS_MACOSX) && defined(ARCH_CPU_X86_64) && !defined(OS_IOS)) || \
(defined(OS_ANDROID) && BUILDFLAG(ENABLE_ARM_CFI_TABLE)) (defined(OS_ANDROID) && BUILDFLAG(ENABLE_ARM_CFI_TABLE))
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
// TODO(https://crbug.com/1098119): Fix unwinding on OS X 10.16. The OS // TODO(https://crbug.com/1098119): Fix unwinding on macOS 11. The OS has
// has moved all system libraries into the dyld shared cache and this // moved all system libraries into the dyld shared cache and this seems to
// seems to break the sampling profiler. // break the sampling profiler.
if (base::mac::IsOSLaterThan10_15_DontCallThis()) if (base::mac::IsAtLeastOS11())
return false; return false;
#endif #endif
#if defined(OS_WIN) #if defined(OS_WIN)
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
#include "base/system/sys_info.h" #include "base/system/sys_info.h"
#include <ApplicationServices/ApplicationServices.h>
#include <CoreServices/CoreServices.h>
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#include <mach/mach_host.h> #include <mach/mach_host.h>
#include <mach/mach_init.h> #include <mach/mach_init.h>
......
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