Bug 1211642: Whitelist test plugin for async plugin init; r=jimm, a=sylvestre
💩💩 backed out by bff8b3d98f72 💩 💩
authorAaron Klotz <aklotz@mozilla.com>
Mon, 12 Oct 2015 13:48:12 -0600
changeset 289582 f585fae6c50a
parent 289581 32de6f21dd48
child 289583 c3daaf421fe6
push id5200
push usercbook@mozilla.com
push date2015-10-19 15:15 +0000
treeherdermozilla-beta@c3daaf421fe6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm, sylvestre
bugs1211642
milestone42.0
Bug 1211642: Whitelist test plugin for async plugin init; r=jimm, a=sylvestre
dom/plugins/base/nsPluginHost.cpp
dom/plugins/base/nsPluginHost.h
dom/plugins/base/nsPluginTags.cpp
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -1906,16 +1906,20 @@ nsPluginHost::SiteHasData(nsIPluginTag* 
   }
   *result = closure->result;
   return closure->retVal;
 }
 
 nsPluginHost::SpecialType
 nsPluginHost::GetSpecialType(const nsACString & aMIMEType)
 {
+  if (aMIMEType.LowerCaseEqualsASCII("application/x-test")) {
+    return eSpecialType_Test;
+  }
+
   if (aMIMEType.LowerCaseEqualsASCII("application/x-shockwave-flash") ||
       aMIMEType.LowerCaseEqualsASCII("application/futuresplash")) {
     return eSpecialType_Flash;
   }
 
   if (aMIMEType.LowerCaseEqualsASCII("application/x-silverlight") ||
       aMIMEType.LowerCaseEqualsASCII("application/x-silverlight-2")) {
     return eSpecialType_Silverlight;
--- a/dom/plugins/base/nsPluginHost.h
+++ b/dom/plugins/base/nsPluginHost.h
@@ -187,16 +187,18 @@ public:
   static nsresult GetPluginTempDir(nsIFile **aDir);
 
   // Helper that checks if a type is whitelisted in plugin.allowed_types.
   // Always returns true if plugin.allowed_types is not set
   static bool IsTypeWhitelisted(const char *aType);
 
   // checks whether aType is a type we recognize for potential special handling
   enum SpecialType { eSpecialType_None,
+                     // Needed to whitelist for async init support
+                     eSpecialType_Test,
                      // Informs some decisions about OOP and quirks
                      eSpecialType_Flash,
                      // Binds to the <applet> tag, has various special
                      // rules around opening channels, codebase, ...
                      eSpecialType_Java,
                      // Some IPC quirks
                      eSpecialType_Silverlight,
                      // Native widget quirks
--- a/dom/plugins/base/nsPluginTags.cpp
+++ b/dom/plugins/base/nsPluginTags.cpp
@@ -349,16 +349,17 @@ void nsPluginTag::InitMime(const char* c
         mSupportsAsyncInit = true;
         break;
       case nsPluginHost::eSpecialType_Flash:
         mIsFlashPlugin = true;
         mSupportsAsyncInit = true;
         break;
       case nsPluginHost::eSpecialType_Silverlight:
       case nsPluginHost::eSpecialType_Unity:
+      case nsPluginHost::eSpecialType_Test:
         mSupportsAsyncInit = true;
         break;
       case nsPluginHost::eSpecialType_None:
       default:
 #ifndef RELEASE_BUILD
         // Allow async init for all plugins on Nightly and Aurora
         mSupportsAsyncInit = true;
 #endif