diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-08 02:19:13 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-08 02:19:13 +0000 |
commit | 9faada102162601ba0a91a85ea82432309a0ca7a (patch) | |
tree | 8aea1e9188d3cac7c19e20371aee1aadd3019b68 /base | |
parent | 83885e932a3b6daf3ecea88bb126c26df6ed89ae (diff) | |
download | chromium_src-9faada102162601ba0a91a85ea82432309a0ca7a.zip chromium_src-9faada102162601ba0a91a85ea82432309a0ca7a.tar.gz chromium_src-9faada102162601ba0a91a85ea82432309a0ca7a.tar.bz2 |
Add a histogram enum to determine the cat's flavor and how many bits there are
in it.
BUG=159886
Review URL: https://codereview.chromium.org/11391002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166585 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/mac/mac_util.h | 8 | ||||
-rw-r--r-- | base/mac/mac_util.mm | 2 | ||||
-rw-r--r-- | base/mac/mac_util_unittest.mm | 9 | ||||
-rw-r--r-- | base/process_util_mac.mm | 3 |
4 files changed, 8 insertions, 14 deletions
diff --git a/base/mac/mac_util.h b/base/mac/mac_util.h index 1b75167..ff8b2b2 100644 --- a/base/mac/mac_util.h +++ b/base/mac/mac_util.h @@ -140,9 +140,8 @@ BASE_EXPORT bool IsOSMountainLionOrLater(); // 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. -BASE_EXPORT - bool IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement(); +// unborn) OS releases, or to log when the OS is newer than any known version. +BASE_EXPORT bool IsOSLaterThanMountainLion_DontCallThis(); // When the deployment target is set, the code produced cannot run on earlier // OS releases. That enables some of the IsOS* family to be implemented as @@ -173,8 +172,7 @@ inline bool IsOSMountainLionOrLater() { return true; } MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_8 #define BASE_MAC_MAC_UTIL_H_INLINED_GT_10_8 inline bool IsOSMountainLion() { return false; } -inline bool IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement() -{ +inline bool IsOSLaterThanMountainLion_DontCallThis() { return true; } #endif diff --git a/base/mac/mac_util.mm b/base/mac/mac_util.mm index a0aa72c..4fb1a42 100644 --- a/base/mac/mac_util.mm +++ b/base/mac/mac_util.mm @@ -604,7 +604,7 @@ bool IsOSMountainLionOrLater() { #endif #if !defined(BASE_MAC_MAC_UTIL_H_INLINED_GT_10_8) -bool IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement() { +bool IsOSLaterThanMountainLion_DontCallThis() { return MacOSXMinorVersion() > MOUNTAIN_LION_MINOR_VERSION; } #endif diff --git a/base/mac/mac_util_unittest.mm b/base/mac/mac_util_unittest.mm index f239036..2984fee 100644 --- a/base/mac/mac_util_unittest.mm +++ b/base/mac/mac_util_unittest.mm @@ -158,8 +158,7 @@ TEST_F(MacUtilTest, IsOSEllipsis) { EXPECT_FALSE(IsOSLionOrLater()); EXPECT_FALSE(IsOSMountainLion()); EXPECT_FALSE(IsOSMountainLionOrLater()); - EXPECT_FALSE( - IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement()); + EXPECT_FALSE(IsOSLaterThanMountainLion_DontCallThis()); } else if (minor == 7) { EXPECT_FALSE(IsOSSnowLeopard()); EXPECT_TRUE(IsOSLion()); @@ -167,8 +166,7 @@ TEST_F(MacUtilTest, IsOSEllipsis) { EXPECT_TRUE(IsOSLionOrLater()); EXPECT_FALSE(IsOSMountainLion()); EXPECT_FALSE(IsOSMountainLionOrLater()); - EXPECT_FALSE( - IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement()); + EXPECT_FALSE(IsOSLaterThanMountainLion_DontCallThis()); } else if (minor == 8) { EXPECT_FALSE(IsOSSnowLeopard()); EXPECT_FALSE(IsOSLion()); @@ -176,8 +174,7 @@ TEST_F(MacUtilTest, IsOSEllipsis) { EXPECT_TRUE(IsOSLionOrLater()); EXPECT_TRUE(IsOSMountainLion()); EXPECT_TRUE(IsOSMountainLionOrLater()); - EXPECT_FALSE( - IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement()); + EXPECT_FALSE(IsOSLaterThanMountainLion_DontCallThis()); } else { // Not five, six, seven, or eight. Ah, ah, ah. EXPECT_TRUE(false); diff --git a/base/process_util_mac.mm b/base/process_util_mac.mm index a81625d..1fa3dbb 100644 --- a/base/process_util_mac.mm +++ b/base/process_util_mac.mm @@ -803,8 +803,7 @@ void oom_killer_new() { // === Core Foundation CFAllocators === bool CanGetContextForCFAllocator() { - return !base::mac:: - IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement(); + return !base::mac::IsOSLaterThanMountainLion_DontCallThis(); } CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) { |