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 607758 7f895eddb97aad8822a9db5e040eed6549926294
parent 607757 a1270dcd67e7c7b423938d5bf4357c51d0e4b692
child 607759 fad9d93a2bd7319c90846d05a9af99c95ab10270
push id68103
push userbwerth@mozilla.com
push dateWed, 12 Jul 2017 21:01:36 +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