Bug 1211642: Whitelist test plugin for async plugin init; r=jimm
authorAaron Klotz <aklotz@mozilla.com>
Mon, 12 Oct 2015 13:48:12 -0600
changeset 267967 f02deaaeb828708c7a5653f659fe7a4d30075f51
parent 267966 5948ac158c28c918a6119d21ae1830c392c55b6d
child 267968 39694c3bc236bc806c08ee34bf08633c75a788ef
push id29536
push usercbook@mozilla.com
push dateFri, 16 Oct 2015 11:18:16 +0000
treeherdermozilla-central@ccf288f65821 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs1211642
milestone44.0a1
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 1211642: Whitelist test plugin for async plugin init; r=jimm
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
@@ -1842,16 +1842,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
@@ -186,16 +186,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
@@ -350,16 +350,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