Bug 1160166 - Disabled plugin meta information often isn't available to content processes. r=jimm
authorBrad Lassey <blassey@mozilla.com>
Tue, 14 Jul 2015 09:21:14 -0400
changeset 253253 1d9aa5e3ba409b37fe68c767f0f3943445b8b731
parent 253252 360bb187e1a196c4c2fbaf22e6e82e427f77d6ae
child 253254 7c25a7938ecc645f22ce829b508cde4bc6ef68bd
push id62390
push userryanvm@gmail.com
push dateThu, 16 Jul 2015 20:10:19 +0000
treeherdermozilla-inbound@1d9aa5e3ba40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs1160166
milestone42.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 1160166 - Disabled plugin meta information often isn't available to content processes. r=jimm
dom/plugins/base/nsPluginHost.cpp
dom/plugins/base/nsPluginHost.h
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -1146,25 +1146,26 @@ nsPluginHost::HavePluginForExtension(con
                                      /* out */ nsACString & aMimeType,
                                      PluginFilter aFilter)
 {
   bool checkEnabled = aFilter & eExcludeDisabled;
   return FindNativePluginForExtension(aExtension, aMimeType, checkEnabled);
 }
 
 void
-nsPluginHost::GetPlugins(nsTArray<nsRefPtr<nsPluginTag> >& aPluginArray)
+nsPluginHost::GetPlugins(nsTArray<nsRefPtr<nsPluginTag> >& aPluginArray,
+                         bool aIncludeDisabled)
 {
   aPluginArray.Clear();
 
   LoadPlugins();
 
   nsPluginTag* plugin = mPlugins;
   while (plugin != nullptr) {
-    if (plugin->IsEnabled()) {
+    if (plugin->IsEnabled() || aIncludeDisabled) {
       aPluginArray.AppendElement(plugin);
     }
     plugin = plugin->mNext;
   }
 }
 
 NS_IMETHODIMP
 nsPluginHost::GetPluginTags(uint32_t* aPluginCount, nsIPluginTag*** aResults)
@@ -2550,17 +2551,17 @@ nsPluginHost::FindPluginsForContent(uint
   LoadPlugins();
 
   *aNewPluginEpoch = ChromeEpoch();
   if (aPluginEpoch == ChromeEpoch()) {
     return;
   }
 
   nsTArray<nsRefPtr<nsPluginTag>> plugins;
-  GetPlugins(plugins);
+  GetPlugins(plugins, true);
 
   for (size_t i = 0; i < plugins.Length(); i++) {
     nsRefPtr<nsPluginTag> tag = plugins[i];
 
     if (!nsNPAPIPlugin::RunPluginOOP(tag)) {
       // Don't expose non-OOP plugins to content processes since we have no way
       // to bridge them over.
       continue;
--- a/dom/plugins/base/nsPluginHost.h
+++ b/dom/plugins/base/nsPluginHost.h
@@ -109,17 +109,19 @@ public:
   bool HavePluginForType(const nsACString & aMimeType,
                          PluginFilter aFilter = eExcludeDisabled);
 
   // FIXME-jsplugins what if fake has different extensions
   bool HavePluginForExtension(const nsACString & aExtension,
                               /* out */ nsACString & aMimeType,
                               PluginFilter aFilter = eExcludeDisabled);
 
-  void GetPlugins(nsTArray<nsRefPtr<nsPluginTag> >& aPluginArray);
+  void GetPlugins(nsTArray<nsRefPtr<nsPluginTag> >& aPluginArray,
+                  bool aIncludeDisabled = false);
+
   void FindPluginsForContent(uint32_t aPluginEpoch,
                              nsTArray<mozilla::plugins::PluginTag>* aPlugins,
                              uint32_t* aNewPluginEpoch);
 
   nsresult GetURL(nsISupports* pluginInst,
                   const char* url,
                   const char* target,
                   nsNPAPIPluginStreamListener* streamListener,