Bug 603417 - Disable oopp for java on windows. r=bsmedberg, josh, a=final.
authorJim Mathies <jmathies@mozilla.com>
Fri, 15 Oct 2010 11:04:39 -0500
changeset 55878 6bef1538745f2067cf1c440db41200e5478580c0
parent 55877 16ef018faad175c87a1557fbc4779f87d66a1dba
child 55879 00e90d9720c851a49dc95ce930f563ac72ad24e6
push id16319
push userjmathies@mozilla.com
push dateFri, 15 Oct 2010 16:09:30 +0000
treeherdermozilla-central@6bef1538745f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg, josh, final
bugs603417
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 603417 - Disable oopp for java on windows. r=bsmedberg, josh, a=final.
modules/libpref/src/init/all.js
modules/plugin/base/src/nsNPAPIPlugin.cpp
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -1315,16 +1315,22 @@ pref("dom.ipc.plugins.timeoutSecs", 45);
 // we consider it failed.
 pref("dom.ipc.plugins.processLaunchTimeoutSecs", 45);
 #else
 // No timeout in DEBUG builds
 pref("dom.ipc.plugins.timeoutSecs", 0);
 pref("dom.ipc.plugins.processLaunchTimeoutSecs", 0);
 #endif
 
+#ifdef XP_WIN
+// Disable oopp for java on windows. They run their own
+// process isolation which conflicts with our implementation.
+pref("dom.ipc.plugins.java.enabled", false);
+#endif
+
 #ifndef ANDROID
 #ifndef XP_MACOSX
 #ifdef XP_UNIX
 // Linux plugins using Xt instead of Xembed don't work out-of-process yet.
 pref("dom.ipc.plugins.enabled.libvlcplugin.so", false);
 pref("dom.ipc.plugins.enabled.nppdf.so", false);
 #endif
 #endif
--- a/modules/plugin/base/src/nsNPAPIPlugin.cpp
+++ b/modules/plugin/base/src/nsNPAPIPlugin.cpp
@@ -311,26 +311,29 @@ static PRBool GMA9XXGraphics()
 
 PRBool
 nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag)
 {
   if (PR_GetEnv("MOZ_DISABLE_OOP_PLUGINS")) {
     return PR_FALSE;
   }
 
+  if (!aPluginTag) {
+    return PR_FALSE;
+  }
+
 #ifdef XP_MACOSX
   // 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 && 
-      aPluginTag->mFileName.EqualsIgnoreCase("flash player.plugin")) {
+  if (aPluginTag->mFileName.EqualsIgnoreCase("flash player.plugin")) {
     // If the first '.' is before position 2 or the version 
     // starts with 10.0 then we are dealing with Flash 10 or less.
     if (aPluginTag->mVersion.FindChar('.') < 2) {
       return PR_FALSE;
     }
     if (aPluginTag->mVersion.Length() >= 4) {
       nsCString versionPrefix;
       aPluginTag->mVersion.Left(versionPrefix, 4);
@@ -380,16 +383,25 @@ nsNPAPIPlugin::RunPluginOOP(const nsPlug
   nsCAutoString prefGroupKey("dom.ipc.plugins.enabled.x86_64.");
 #elif defined(__ppc__)
   nsCAutoString prefGroupKey("dom.ipc.plugins.enabled.ppc.");
 #endif
 #else
   nsCAutoString prefGroupKey("dom.ipc.plugins.enabled.");
 #endif
 
+  // Java plugins include a number of different file names,
+  // so use the mime type (mIsJavaPlugin) and a special pref.
+  PRBool javaIsEnabled;
+  if (aPluginTag->mIsJavaPlugin &&
+      NS_SUCCEEDED(prefs->GetBoolPref("dom.ipc.plugins.java.enabled", &javaIsEnabled)) &&
+      !javaIsEnabled) {
+    return PR_FALSE;
+  }
+
   PRUint32 prefCount;
   char** prefNames;
   nsresult rv = prefs->GetChildList(prefGroupKey.get(),
                                     &prefCount, &prefNames);
 
   PRBool oopPluginsEnabled = PR_FALSE;
   PRBool prefSet = PR_FALSE;