summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chromium/base/allocator/allocator_interception_mac.mm2
-rw-r--r--chromium/base/mac/mac_util.h10
-rw-r--r--chromium/base/mac/mac_util_unittest.mm39
3 files changed, 43 insertions, 8 deletions
diff --git a/chromium/base/allocator/allocator_interception_mac.mm b/chromium/base/allocator/allocator_interception_mac.mm
index 4980051aff8..68fa5468b59 100644
--- a/chromium/base/allocator/allocator_interception_mac.mm
+++ b/chromium/base/allocator/allocator_interception_mac.mm
@@ -211,7 +211,7 @@ void* oom_killer_memalign_purgeable(struct _malloc_zone_t* zone,
// === Core Foundation CFAllocators ===
bool CanGetContextForCFAllocator() {
- return !base::mac::IsOSLaterThan10_12_DontCallThis();
+ return !base::mac::IsOSLaterThan10_13_DontCallThis();
}
CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) {
diff --git a/chromium/base/mac/mac_util.h b/chromium/base/mac/mac_util.h
index 67d1880849e..37e5b670cee 100644
--- a/chromium/base/mac/mac_util.h
+++ b/chromium/base/mac/mac_util.h
@@ -147,6 +147,12 @@ DEFINE_IS_OS_FUNCS(12, TEST_DEPLOYMENT_TARGET)
DEFINE_IS_OS_FUNCS(12, IGNORE_DEPLOYMENT_TARGET)
#endif
+#ifdef MAC_OS_X_VERSION_10_13
+DEFINE_IS_OS_FUNCS(13, TEST_DEPLOYMENT_TARGET)
+#else
+DEFINE_IS_OS_FUNCS(13, IGNORE_DEPLOYMENT_TARGET)
+#endif
+
#undef IGNORE_DEPLOYMENT_TARGET
#undef TEST_DEPLOYMENT_TARGET
#undef DEFINE_IS_OS_FUNCS
@@ -154,8 +160,8 @@ DEFINE_IS_OS_FUNCS(12, IGNORE_DEPLOYMENT_TARGET)
// 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,
// unborn) OS releases, or to log when the OS is newer than any known version.
-inline bool IsOSLaterThan10_12_DontCallThis() {
- return !IsAtMostOS10_12();
+inline bool IsOSLaterThan10_13_DontCallThis() {
+ return !IsAtMostOS10_13();
}
// Retrieve the system's model identifier string from the IOKit registry:
diff --git a/chromium/base/mac/mac_util_unittest.mm b/chromium/base/mac/mac_util_unittest.mm
index ff508f3336b..266d1c42947 100644
--- a/chromium/base/mac/mac_util_unittest.mm
+++ b/chromium/base/mac/mac_util_unittest.mm
@@ -150,7 +150,10 @@ TEST_F(MacUtilTest, IsOSEllipsis) {
EXPECT_FALSE(IsOS10_12());
EXPECT_FALSE(IsAtLeastOS10_12());
EXPECT_TRUE(IsAtMostOS10_12());
- EXPECT_FALSE(IsOSLaterThan10_12_DontCallThis());
+ EXPECT_FALSE(IsOS10_13());
+ EXPECT_FALSE(IsAtLeastOS10_13());
+ EXPECT_TRUE(IsAtMostOS10_13());
+ EXPECT_FALSE(IsOSLaterThan10_13_DontCallThis());
} else if (minor == 10) {
EXPECT_FALSE(IsOS10_9());
EXPECT_FALSE(IsAtMostOS10_9());
@@ -164,7 +167,10 @@ TEST_F(MacUtilTest, IsOSEllipsis) {
EXPECT_FALSE(IsOS10_12());
EXPECT_FALSE(IsAtLeastOS10_12());
EXPECT_TRUE(IsAtMostOS10_12());
- EXPECT_FALSE(IsOSLaterThan10_12_DontCallThis());
+ EXPECT_FALSE(IsOS10_13());
+ EXPECT_FALSE(IsAtLeastOS10_13());
+ EXPECT_TRUE(IsAtMostOS10_13());
+ EXPECT_FALSE(IsOSLaterThan10_13_DontCallThis());
} else if (minor == 11) {
EXPECT_FALSE(IsOS10_9());
EXPECT_FALSE(IsAtMostOS10_9());
@@ -178,7 +184,10 @@ TEST_F(MacUtilTest, IsOSEllipsis) {
EXPECT_FALSE(IsOS10_12());
EXPECT_FALSE(IsAtLeastOS10_12());
EXPECT_TRUE(IsAtMostOS10_12());
- EXPECT_FALSE(IsOSLaterThan10_12_DontCallThis());
+ EXPECT_FALSE(IsOS10_13());
+ EXPECT_FALSE(IsAtLeastOS10_13());
+ EXPECT_TRUE(IsAtMostOS10_13());
+ EXPECT_FALSE(IsOSLaterThan10_13_DontCallThis());
} else if (minor == 12) {
EXPECT_FALSE(IsOS10_9());
EXPECT_FALSE(IsAtMostOS10_9());
@@ -192,9 +201,29 @@ TEST_F(MacUtilTest, IsOSEllipsis) {
EXPECT_TRUE(IsOS10_12());
EXPECT_TRUE(IsAtMostOS10_12());
EXPECT_TRUE(IsAtLeastOS10_12());
- EXPECT_FALSE(IsOSLaterThan10_12_DontCallThis());
+ EXPECT_FALSE(IsOS10_13());
+ EXPECT_FALSE(IsAtLeastOS10_13());
+ EXPECT_TRUE(IsAtMostOS10_13());
+ EXPECT_FALSE(IsOSLaterThan10_13_DontCallThis());
+ } else if (minor == 13) {
+ EXPECT_FALSE(IsOS10_9());
+ EXPECT_FALSE(IsAtMostOS10_9());
+ EXPECT_TRUE(IsAtLeastOS10_9());
+ EXPECT_FALSE(IsOS10_10());
+ EXPECT_FALSE(IsAtMostOS10_10());
+ EXPECT_TRUE(IsAtLeastOS10_10());
+ EXPECT_FALSE(IsOS10_11());
+ EXPECT_FALSE(IsAtMostOS10_11());
+ EXPECT_TRUE(IsAtLeastOS10_11());
+ EXPECT_FALSE(IsOS10_12());
+ EXPECT_FALSE(IsAtMostOS10_12());
+ EXPECT_TRUE(IsAtLeastOS10_12());
+ EXPECT_TRUE(IsOS10_13());
+ EXPECT_TRUE(IsAtLeastOS10_13());
+ EXPECT_TRUE(IsAtMostOS10_13());
+ EXPECT_FALSE(IsOSLaterThan10_13_DontCallThis());
} else {
- // Not nine, ten, eleven, or twelve. Ah, ah, ah.
+ // Not nine, ten, eleven, twelve, or thirteen. Ah, ah, ah.
EXPECT_TRUE(false);
}
} else {