Bug 1059424 Part 2: Simplify nsAppFileLocationProvider Java plugin detection now that we are minimum macOS 10.9. draft
authorBrad Werth <bwerth@mozilla.com>
Mon, 10 Jul 2017 15:37:46 -0700
changeset 607136 b86848cf7ccdc6086154535e063587812e988257
parent 607081 e91d105c2de727767c6d78b694bad50a38abf100
child 607137 3bcbaabd38751e8daa36a8b054ae3430b6a06871
push id67901
push userbwerth@mozilla.com
push dateTue, 11 Jul 2017 21:56:51 +0000
bugs1059424
milestone56.0a1
Bug 1059424 Part 2: Simplify nsAppFileLocationProvider Java plugin detection now that we are minimum macOS 10.9. MozReview-Commit-ID: CkmH2ngEDKT
xpcom/io/nsAppFileLocationProvider.cpp
--- a/xpcom/io/nsAppFileLocationProvider.cpp
+++ b/xpcom/io/nsAppFileLocationProvider.cpp
@@ -10,17 +10,16 @@
 #include "nsEnumeratorUtils.h"
 #include "nsIAtom.h"
 #include "nsIFile.h"
 #include "nsString.h"
 #include "nsXPIDLString.h"
 #include "nsISimpleEnumerator.h"
 #include "prenv.h"
 #include "nsCRT.h"
-
 #if defined(MOZ_WIDGET_COCOA)
 #include <Carbon/Carbon.h>
 #include "nsILocalFileMac.h"
 #elif defined(XP_WIN)
 #include <windows.h>
 #include <shlobj.h>
 #elif defined(XP_UNIX)
 #include <unistd.h>
@@ -549,17 +548,16 @@ nsAppFileLocationProvider::GetFiles(cons
     // "normal" locations.  So we won't be able to find it unless we look in the "non-normal"
     // location where it actually is.  Safari can use the WebKit-specific JavaPluginCocoa.bundle,
     // which (of course) is still fully supported on OS X 10.5.  But we have no alternative to
     // using Java Plugin2.  For more information see bug 668639.
     static const char* keys[] = {
       NS_APP_PLUGINS_DIR,
       NS_MACOSX_USER_PLUGIN_DIR,
       NS_MACOSX_LOCAL_PLUGIN_DIR,
-      IsOSXLeopard() ? NS_MACOSX_JAVA2_PLUGIN_DIR : nullptr,
       nullptr
     };
     *aResult = new nsAppDirectoryEnumerator(this, keys);
 #else
 #ifdef XP_UNIX
     static const char* keys[] = { nullptr, NS_USER_PLUGINS_DIR, NS_APP_PLUGINS_DIR, NS_SYSTEM_PLUGINS_DIR, nullptr };
 #else
     static const char* keys[] = { nullptr, NS_USER_PLUGINS_DIR, NS_APP_PLUGINS_DIR, nullptr };
@@ -583,27 +581,8 @@ nsAppFileLocationProvider::GetFiles(cons
     NS_ADDREF(*aResult);
     rv = NS_OK;
   }
   if (!strcmp(aProp, NS_APP_DISTRIBUTION_SEARCH_DIR_LIST)) {
     return NS_NewEmptyEnumerator(aResult);
   }
   return rv;
 }
-
-#if defined(MOZ_WIDGET_COCOA)
-bool
-nsAppFileLocationProvider::IsOSXLeopard()
-{
-  static SInt32 version = 0;
-
-  if (!version) {
-    OSErr err = ::Gestalt(gestaltSystemVersion, &version);
-    if (err != noErr) {
-      version = 0;
-    } else {
-      version &= 0xFFFF; // The system version is in the low order word
-    }
-  }
-
-  return ((version >= 0x1050) && (version < 0x1060));
-}
-#endif