bug 1186948 - Follow up, need to QI the plugin tag r=mconley

This commit is contained in:
Brad Lassey 2016-06-10 16:41:31 -04:00
parent e680d73b96
commit b1a7d53d2f

View File

@ -121,7 +121,7 @@ PluginContent.prototype = {
},
observe: function observe(aSubject, aTopic, aData) {
let pluginTag = aSubject;
let pluginTag = aSubject.QueryInterface(Ci.nsIPluginTag);
if (aTopic == "Plugin::HiddenPluginTouched") {
this._showClickToPlayNotification(pluginTag, false);
} else {
@ -207,7 +207,7 @@ PluginContent.prototype = {
};
},
_getPluginInfoForTag: function (pluginTag, tagMimetype, fallbackType) {
_getPluginInfoForTag: function (pluginTag, tagMimetype) {
let pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
let pluginName = gNavigatorBundle.GetStringFromName("pluginInfo.unknownPlugin");
@ -241,7 +241,7 @@ PluginContent.prototype = {
pluginName: pluginName,
pluginTag: pluginTag,
permissionString: permissionString,
fallbackType: fallbackType,
fallbackType: null,
blocklistState: blocklistState,
};
},
@ -762,7 +762,13 @@ PluginContent.prototype = {
let location = this.content.document.location.href;
for (let p of plugins) {
let pluginInfo = this._getPluginInfo(p);
let pluginInfo;
if (p instanceof Ci.nsIPluginTag) {
let mimeType = p.getMimeTypes() > 0 ? p.getMimeTypes()[0] : null;
pluginInfo = this._getPluginInfoForTag(p, mimeType);
} else {
pluginInfo = this._getPluginInfo(p);
}
if (pluginInfo.permissionString === null) {
Cu.reportError("No permission string for active plugin.");
continue;