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

Unified Diff: third_party/WebKit/Source/platform/mac/VersionUtilMac.h

Issue 2271653006: base::mac::IsOSSierra() -> base::mac::IsOS10_12(), etc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Add SDK guards to blink, simplify how IsOS* are defined Created 4 years, 4 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
Index: third_party/WebKit/Source/platform/mac/VersionUtilMac.h
diff --git a/third_party/WebKit/Source/platform/mac/VersionUtilMac.h b/third_party/WebKit/Source/platform/mac/VersionUtilMac.h
index ccff619df8d9d466d8dc4d1e3271d87e4008d04b..e043cd959ac3e6f5ab593a6700ddeb2e3ecbec3d 100644
--- a/third_party/WebKit/Source/platform/mac/VersionUtilMac.h
+++ b/third_party/WebKit/Source/platform/mac/VersionUtilMac.h
@@ -7,16 +7,37 @@
#include "platform/PlatformExport.h"
+#include <AvailabilityMacros.h>
+
namespace blink {
-// Mavericks is Mac OS X 10.9, Darwin 13.
-PLATFORM_EXPORT bool IsOSMavericks();
+namespace internal {
+
+PLATFORM_EXPORT int MacOSXMinorVersion();
+
+template <int V, int ID>
+constexpr bool IsOS()
+{
+ return (!ID || MAC_OS_X_VERSION_MIN_REQUIRED <= ID) && MacOSXMinorVersion() == V;
+}
+
+} // namespace internal
+
+const auto IsOS10_9 = internal::IsOS<9, MAC_OS_X_VERSION_10_9>;
+const auto IsOS10_10 = internal::IsOS<10, MAC_OS_X_VERSION_10_10>;
-// Yosemite is Mac OS X 10.10, Darwin 14.
-PLATFORM_EXPORT bool IsOSYosemite();
+// Remove these guards when we bump our SDK version
+#if defined(MAC_OS_X_VERSION_10_11)
+const auto IsOS10_11 = internal::IsOS<11, MAC_OS_X_VERSION_10_11>;
+#else
+const auto IsOS10_11 = internal::IsOS<11, 0>;
+#endif
-// El Capitan is Mac OS X 10.11, Darwin 15.
-PLATFORM_EXPORT bool IsOSElCapitan();
+#if defined(MAC_OS_X_VERSION_10_12)
+DECLARE_IS_OS_FUNCS(12, MAC_OS_X_VERSION_10_12)
+#else
+DECLARE_IS_OS_FUNCS(12, 0)
+#endif
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698