Bug 634814: Further limit Flash OOP logic (all of it) to i386 on Mac OS X. There is no case in which we'd want to hard-code running Flash in-process in a 64-bit browser. r=benwa a=josh
authorJosh Aas <joshmoz@gmail.com>
Sun, 20 Feb 2011 18:06:25 -0500
changeset 62890 b5a403b079d3b8c65d37e912de81b7f53c5c2e89
parent 62889 fe2375f12819ff47afd3ea8595077dc7f6f1ddb8
child 62891 d30bc9781cfd23b7cd2dcb8720dd91863c098015
push id1
push userroot
push dateTue, 10 Dec 2013 15:46:25 +0000
reviewersbenwa, josh
bugs634814
milestone2.0b12pre
Bug 634814: Further limit Flash OOP logic (all of it) to i386 on Mac OS X. There is no case in which we'd want to hard-code running Flash in-process in a 64-bit browser. r=benwa a=josh
modules/plugin/base/src/nsNPAPIPlugin.cpp
--- a/modules/plugin/base/src/nsNPAPIPlugin.cpp
+++ b/modules/plugin/base/src/nsNPAPIPlugin.cpp
@@ -272,32 +272,31 @@ nsNPAPIPlugin::PluginCrashed(const nsASt
 {
   nsRefPtr<nsPluginHost> host = dont_AddRef(nsPluginHost::GetInst());
   host->PluginCrashed(this, pluginDumpID, browserDumpID);
 }
 #endif
 
 #ifdef MOZ_IPC
 
-#ifdef XP_MACOSX
+#if defined(XP_MACOSX) && defined(__i386__)
 static PRInt32 OSXVersion()
 {
   static PRInt32 gOSXVersion = 0x0;
   if (gOSXVersion == 0x0) {
     OSErr err = ::Gestalt(gestaltSystemVersion, (SInt32*)&gOSXVersion);
     if (err != noErr) {
       // This should probably be changed when our minimum version changes
       NS_ERROR("Couldn't determine OS X version, assuming 10.5");
       gOSXVersion = 0x00001050;
     }
   }
   return gOSXVersion;
 }
 
-#if defined(__i386__)
 // Detects machines with Intel GMA9xx GPUs.
 // kCGLRendererIDMatchingMask and kCGLRendererIntel900ID are only defined in the 10.6 SDK.
 #define CGLRendererIDMatchingMask 0x00FE7F00
 #define CGLRendererIntel900ID 0x00024000
 static PRBool GMA9XXGraphics()
 {
   bool hasIntelGMA9XX = PR_FALSE;
   CGLRendererInfoObj renderer = 0;
@@ -312,30 +311,29 @@ static PRBool GMA9XXGraphics()
         }
       }
     }
     ::CGLDestroyRendererInfo(renderer);
   }
   return hasIntelGMA9XX;
 }
 #endif
-#endif
 
 PRBool
 nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag)
 {
   if (PR_GetEnv("MOZ_DISABLE_OOP_PLUGINS")) {
     return PR_FALSE;
   }
 
   if (!aPluginTag) {
     return PR_FALSE;
   }
 
-#ifdef XP_MACOSX
+#if defined(XP_MACOSX) && defined(__i386__)
   // Only allow on Mac OS X 10.6 or higher.
   if (OSXVersion() < 0x00001060) {
     return PR_FALSE;
   }
   // Blacklist Flash 10.0 or lower since it may try to negotiate Carbon/Quickdraw
   // which are not supported out of process. Also blacklist Flash 10.1 if this
   // machine has an Intel GMA9XX GPU because Flash will negotiate Quickdraw graphics.
   if (aPluginTag->mFileName.EqualsIgnoreCase("flash player.plugin")) {
@@ -347,23 +345,21 @@ nsNPAPIPlugin::RunPluginOOP(const nsPlug
     if (aPluginTag->mVersion.Length() >= 4) {
       nsCString versionPrefix;
       aPluginTag->mVersion.Left(versionPrefix, 4);
       if (versionPrefix.EqualsASCII("10.0")) {
         return PR_FALSE;
       }
     }
 
-#if defined(__i386__)
     // At this point we have Flash 10.1+ but now we also need to blacklist
     // if the machine has a Intel GMA9XX GPU.
     if (GMA9XXGraphics()) {
       return PR_FALSE;
     }
-#endif
   }
 #endif
 
 #ifdef XP_WIN
   OSVERSIONINFO osVerInfo = {0};
   osVerInfo.dwOSVersionInfoSize = sizeof(osVerInfo);
   GetVersionEx(&osVerInfo);
   // Always disabled on 2K or less. (bug 536303)