Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2774)

Unified Diff: base/mac/mac_util.mm

Issue 9706001: [Mac] Add the OS version check functions for 10.8. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/mac/mac_util.h ('k') | base/mac/mac_util_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mac/mac_util.mm
diff --git a/base/mac/mac_util.mm b/base/mac/mac_util.mm
index 1240906bb7fcd7e12df650b7747831e517eeaf1d..41d76a2b080fa42b38c1eb36b5ee5ecd7e528d75 100644
--- a/base/mac/mac_util.mm
+++ b/base/mac/mac_util.mm
@@ -554,7 +554,7 @@ int MacOSXMinorVersionInternal() {
// immediate death.
CHECK(darwin_major_version >= 6);
int mac_os_x_minor_version = darwin_major_version - 4;
- DLOG_IF(WARNING, darwin_major_version > 11) << "Assuming Darwin "
+ DLOG_IF(WARNING, darwin_major_version > 12) << "Assuming Darwin "
<< base::IntToString(darwin_major_version) << " is Mac OS X 10."
<< base::IntToString(mac_os_x_minor_version);
@@ -571,7 +571,8 @@ int MacOSXMinorVersion() {
enum {
LEOPARD_MINOR_VERSION = 5,
SNOW_LEOPARD_MINOR_VERSION = 6,
- LION_MINOR_VERSION = 7
+ LION_MINOR_VERSION = 7,
+ MOUNTAIN_LION_MINOR_VERSION = 8,
};
} // namespace
@@ -612,6 +613,12 @@ bool IsOSLion() {
}
#endif
+#if !defined(BASE_MAC_MAC_UTIL_H_INLINED_GT_10_7)
+bool IsOSLionOrEarlier() {
+ return MacOSXMinorVersion() <= LION_MINOR_VERSION;
+}
+#endif
+
#if !defined(BASE_MAC_MAC_UTIL_H_INLINED_GE_10_7)
bool IsOSLionOrLater() {
return MacOSXMinorVersion() >= LION_MINOR_VERSION;
@@ -624,6 +631,24 @@ bool IsOSLaterThanLion() {
}
#endif
+#if !defined(BASE_MAC_MAC_UTIL_H_INLINED_GT_10_8)
+bool IsOSMountainLion() {
+ return MacOSXMinorVersion() == MOUNTAIN_LION_MINOR_VERSION;
+}
+#endif
+
+#if !defined(BASE_MAC_MAC_UTIL_H_INLINED_GE_10_8)
+bool IsOSMountainLionOrLater() {
+ return MacOSXMinorVersion() >= MOUNTAIN_LION_MINOR_VERSION;
+}
+#endif
+
+#if !defined(BASE_MAC_MAC_UTIL_H_INLINED_GT_10_8)
+bool IsOSDangerouslyLaterThanMountainLionForUseByCFAllocatorReplacement() {
+ return MacOSXMinorVersion() > MOUNTAIN_LION_MINOR_VERSION;
+}
+#endif
+
namespace {
// ScopedGenericObj functor for IOObjectRelease().
« no previous file with comments | « base/mac/mac_util.h ('k') | base/mac/mac_util_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698