Bug 711564 - Disable ICA/CA Plug-in drawing model on 10.5 because of instability. r=smichaud
authorBenoit Girard <b56girard@gmail.com>
Mon, 09 Jan 2012 19:11:04 -0500
changeset 85372 8eb5fd52246138ddf748a6c44e7fdbd44f5608fb
parent 85371 8db1c4599e7b7fd87f31e38f00b26df499b20990
child 85373 a537453b1d667a66d5272915e43499eedb3554b5
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmichaud
bugs711564
milestone12.0a1
Bug 711564 - Disable ICA/CA Plug-in drawing model on 10.5 because of instability. r=smichaud
dom/plugins/base/nsNPAPIPlugin.cpp
dom/plugins/ipc/PluginInstanceChild.cpp
widget/cocoa/nsCocoaFeatures.h
widget/cocoa/nsCocoaFeatures.mm
--- a/dom/plugins/base/nsNPAPIPlugin.cpp
+++ b/dom/plugins/base/nsNPAPIPlugin.cpp
@@ -87,16 +87,17 @@
 
 #include "nsIObserverService.h"
 #include <prinrval.h>
 
 #ifdef MOZ_WIDGET_COCOA
 #include <Carbon/Carbon.h>
 #include <ApplicationServices/ApplicationServices.h>
 #include <OpenGL/OpenGL.h>
+#include "nsCocoaFeatures.h"
 #endif
 
 // needed for nppdf plugin
 #ifdef MOZ_WIDGET_GTK2
 #include <gdk/gdk.h>
 #include <gdk/gdkx.h>
 #include "gtk2xtbin.h"
 #endif
@@ -2252,23 +2253,23 @@ NPError NP_CALLBACK
 
   case NPNVsupportsCoreGraphicsBool: {
     *(NPBool*)result = true;
     
     return NPERR_NO_ERROR;
   }
 
    case NPNVsupportsCoreAnimationBool: {
-     *(NPBool*)result = true;
+     *(NPBool*)result = nsCocoaFeatures::SupportCoreAnimationPlugins();
 
      return NPERR_NO_ERROR;
    }
 
    case NPNVsupportsInvalidatingCoreAnimationBool: {
-     *(NPBool*)result = true;
+     *(NPBool*)result = nsCocoaFeatures::SupportCoreAnimationPlugins();
 
      return NPERR_NO_ERROR;
    }
 
 
 #ifndef NP_NO_CARBON
   case NPNVsupportsCarbonBool: {
     *(NPBool*)result = true;
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -113,16 +113,17 @@ using mozilla::gfx::SharedDIB;
 // from Chromium's web plugin delegate src. See 'flash msg throttling
 // helpers' section for details.
 const int kFlashWMUSERMessageThrottleDelayMs = 5;
 
 static const TCHAR kPluginIgnoreSubclassProperty[] = TEXT("PluginIgnoreSubclassProperty");
 
 #elif defined(XP_MACOSX)
 #include <ApplicationServices/ApplicationServices.h>
+#include "nsCocoaFeatures.h"
 #include "PluginUtilsOSX.h"
 #endif // defined(XP_MACOSX)
 
 template<>
 struct RunnableMethodTraits<PluginInstanceChild>
 {
     static void RetainCallee(PluginInstanceChild* obj) { }
     static void ReleaseCallee(PluginInstanceChild* obj) { }
@@ -415,22 +416,22 @@ PluginInstanceChild::NPN_GetValue(NPNVar
 
 #ifdef XP_MACOSX
    case NPNVsupportsCoreGraphicsBool: {
         *((NPBool*)aValue) = true;
         return NPERR_NO_ERROR;
     }
 
     case NPNVsupportsCoreAnimationBool: {
-        *((NPBool*)aValue) = true;
+        *((NPBool*)aValue) = nsCocoaFeatures::SupportCoreAnimationPlugins();
         return NPERR_NO_ERROR;
     }
 
     case NPNVsupportsInvalidatingCoreAnimationBool: {
-        *((NPBool*)aValue) = true;
+        *((NPBool*)aValue) = nsCocoaFeatures::SupportCoreAnimationPlugins();
         return NPERR_NO_ERROR;
     }
 
     case NPNVsupportsCocoaBool: {
         *((NPBool*)aValue) = true;
         return NPERR_NO_ERROR;
     }
 
--- a/widget/cocoa/nsCocoaFeatures.h
+++ b/widget/cocoa/nsCocoaFeatures.h
@@ -40,14 +40,16 @@
 #define nsCocoaFeatures_h_
 
 #include "prtypes.h"
 
 class nsCocoaFeatures {
 public:
   static PRInt32 OSXVersion();
 
-  static bool OnSnowLeopardOrLater();  
-  static bool OnLionOrLater();  
+  static bool OnSnowLeopardOrLater();
+  static bool OnLionOrLater();
+
+  static bool SupportCoreAnimationPlugins();
 private:
   static PRInt32 mOSXVersion;
 };
 #endif // nsCocoaFeatures_h_
--- a/widget/cocoa/nsCocoaFeatures.mm
+++ b/widget/cocoa/nsCocoaFeatures.mm
@@ -63,16 +63,24 @@ nsCocoaFeatures::OSXVersion()
             mOSXVersion = MAC_OS_X_VERSION_10_5_HEX;
         }
         mOSXVersion &= MAC_OS_X_VERSION_MASK;
     }
     return mOSXVersion;
 }
 
 /* static */ bool
+nsCocoaFeatures::SupportCoreAnimationPlugins()
+{
+    // Disallow Core Animation on 10.5 because of crashes.
+    // See Bug 711564.
+    return (OSXVersion() >= MAC_OS_X_VERSION_10_6_HEX);
+}
+
+/* static */ bool
 nsCocoaFeatures::OnSnowLeopardOrLater()
 {
     return (OSXVersion() >= MAC_OS_X_VERSION_10_6_HEX);
 }
 
 /* static */ bool
 nsCocoaFeatures::OnLionOrLater()
 {