Bug 1403945 - Add utility functions to recognize OS X 10.13. r=mstange, a=IanN CLOSED TREE DONTBUILD SEAMONKEY_2_49_ESR_RELBRANCH
authorMilan Sreckovic <milan@mozilla.com>
Thu, 28 Sep 2017 10:21:10 -0400
branchSEAMONKEY_2_49_ESR_RELBRANCH
changeset 357529 3e238bb605dd4fdedeaef4fb9b07425ebdea705f
parent 357528 c857231c34dffa83b0c5f84aa25d693af1c21f1f
child 357530 957d35877f6f9143ed802545e4961baacecb7565
push id7834
push userfrgrahl@gmx.net
push dateSun, 13 Jan 2019 12:17:02 +0000
treeherdermozilla-esr52@6e4ad8a8f2e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange, IanN
bugs1403945
milestone52.9.1
Bug 1403945 - Add utility functions to recognize OS X 10.13. r=mstange, a=IanN CLOSED TREE DONTBUILD mozilla-esr52 SEAMONKEY_2_49_ESR_RELBRANCH
widget/GfxDriverInfo.h
widget/GfxInfoBase.cpp
widget/cocoa/GfxInfo.mm
widget/cocoa/nsCocoaFeatures.h
widget/cocoa/nsCocoaFeatures.mm
--- a/widget/GfxDriverInfo.h
+++ b/widget/GfxDriverInfo.h
@@ -53,16 +53,17 @@ enum class OperatingSystem {
   OSX10_5,
   OSX10_6,
   OSX10_7,
   OSX10_8,
   OSX10_9,
   OSX10_10,
   OSX10_11,
   OSX10_12,
+  OSX10_13,
   Android,
   Ios
 };
 
 enum VersionComparisonOp {
   DRIVER_LESS_THAN,             // driver <  version
   DRIVER_BUILD_ID_LESS_THAN,    // driver build id <  version
   DRIVER_LESS_THAN_OR_EQUAL,    // driver <= version
--- a/widget/GfxInfoBase.cpp
+++ b/widget/GfxInfoBase.cpp
@@ -279,16 +279,18 @@ BlacklistOSToOperatingSystem(const nsASt
   else if (os.EqualsLiteral("Darwin 13"))
     return OperatingSystem::OSX10_9;
   else if (os.EqualsLiteral("Darwin 14"))
     return OperatingSystem::OSX10_10;
   else if (os.EqualsLiteral("Darwin 15"))
     return OperatingSystem::OSX10_11;
   else if (os.EqualsLiteral("Darwin 16"))
     return OperatingSystem::OSX10_12;
+  else if (os.EqualsLiteral("Darwin 17"))
+    return OperatingSystem::OSX10_13;
   else if (os.EqualsLiteral("Android"))
     return OperatingSystem::Android;
   // For historical reasons, "All" in blocklist means "All Windows"
   else if (os.EqualsLiteral("All"))
     return OperatingSystem::Windows;
 
   return OperatingSystem::Unknown;
 }
--- a/widget/cocoa/GfxInfo.mm
+++ b/widget/cocoa/GfxInfo.mm
@@ -49,16 +49,18 @@ OSXVersionToOperatingSystem(uint32_t aOS
       case 9:
         return OperatingSystem::OSX10_9;
       case 10:
         return OperatingSystem::OSX10_10;
       case 11:
         return OperatingSystem::OSX10_11;
       case 12:
         return OperatingSystem::OSX10_12;
+      case 13:
+        return OperatingSystem::OSX10_13;
     }
   }
 
   return OperatingSystem::Unknown;
 }
 // The following three functions are derived from Chromium code
 static CFTypeRef SearchPortForProperty(io_registry_entry_t dspPort,
                                        CFStringRef propertyName)
--- a/widget/cocoa/nsCocoaFeatures.h
+++ b/widget/cocoa/nsCocoaFeatures.h
@@ -16,16 +16,17 @@ class nsCocoaFeatures {
 public:
   static int32_t OSXVersion();
   static int32_t OSXVersionMajor();
   static int32_t OSXVersionMinor();
   static int32_t OSXVersionBugFix();
   static bool OnYosemiteOrLater();
   static bool OnElCapitanOrLater();
   static bool OnSierraOrLater();
+  static bool OnHighSierraOrLater();
 
   static bool IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFix=0);
 
   // These are utilities that do not change or depend on the value of mOSXVersion
   // and instead just encapsulate the encoding algorithm.  Note that GetVersion
   // actually adjusts to the lowest supported OS, so it will always return
   // a "supported" version.  GetSystemVersion does not make any modifications.
   static void GetSystemVersion(int &aMajor, int &aMinor, int &aBugFix);
--- a/widget/cocoa/nsCocoaFeatures.mm
+++ b/widget/cocoa/nsCocoaFeatures.mm
@@ -14,16 +14,17 @@
 #define MAC_OS_X_VERSION_MASK      0x0000FFFF
 #define MAC_OS_X_VERSION_10_0_HEX  0x00001000
 #define MAC_OS_X_VERSION_10_7_HEX  0x00001070
 #define MAC_OS_X_VERSION_10_8_HEX  0x00001080
 #define MAC_OS_X_VERSION_10_9_HEX  0x00001090
 #define MAC_OS_X_VERSION_10_10_HEX 0x000010A0
 #define MAC_OS_X_VERSION_10_11_HEX 0x000010B0
 #define MAC_OS_X_VERSION_10_12_HEX 0x000010C0
+#define MAC_OS_X_VERSION_10_13_HEX 0x000010D0
 
 #include "nsCocoaFeatures.h"
 #include "nsCocoaUtils.h"
 #include "nsDebug.h"
 #include "nsObjCExceptions.h"
 
 #import <Cocoa/Cocoa.h>
 
@@ -163,12 +164,18 @@ nsCocoaFeatures::OnElCapitanOrLater()
 
 /* static */ bool
 nsCocoaFeatures::OnSierraOrLater()
 {
     return (OSXVersion() >= MAC_OS_X_VERSION_10_12_HEX);
 }
 
 /* static */ bool
+nsCocoaFeatures::OnHighSierraOrLater()
+{
+    return (OSXVersion() >= MAC_OS_X_VERSION_10_13_HEX);
+}
+
+/* static */ bool
 nsCocoaFeatures::IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFix)
 {
     return OSXVersion() >= GetVersion(aMajor, aMinor, aBugFix);
 }