Backed out 3 changesets (bug 889480, bug 889788, bug 888908) for mochitest-bc orange.

Backed out changeset d1c616745325 (bug 889788)
Backed out changeset 6fe281a19554 (bug 888908)
Backed out changeset 9b855bab8073 (bug 889480)
This commit is contained in:
Ryan VanderMeulen 2013-07-17 11:34:25 -04:00
parent 2c331edac2
commit 8f0d3e140e
5 changed files with 37 additions and 77 deletions

View File

@ -217,21 +217,14 @@ var gPluginHandler = {
},
handleEvent : function(event) {
let plugin;
let doc;
let plugin = event.target;
let doc = plugin.ownerDocument;
// We're expecting the target to be a plugin.
if (!(plugin instanceof Ci.nsIObjectLoadingContent))
return;
let eventType = event.type;
if (eventType === "PluginRemoved") {
doc = event.target;
}
else {
plugin = event.target;
doc = plugin.ownerDocument;
if (!(plugin instanceof Ci.nsIObjectLoadingContent))
return;
}
if (eventType == "PluginBindingAttached") {
// The plugin binding fires this event when it is created.
// As an untrusted event, ensure that this object actually has a binding
@ -311,7 +304,6 @@ var gPluginHandler = {
break;
case "PluginInstantiated":
case "PluginRemoved":
this._showClickToPlayNotification(browser);
break;
}
@ -694,12 +686,18 @@ var gPluginHandler = {
switch (aNewState) {
case "allownow":
if (aPluginInfo.fallbackType == Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE) {
return;
}
permission = Ci.nsIPermissionManager.ALLOW_ACTION;
expireType = Ci.nsIPermissionManager.EXPIRE_SESSION;
expireTime = Date.now() + Services.prefs.getIntPref(this.PREF_SESSION_PERSIST_MINUTES) * 60 * 1000;
break;
case "allowalways":
if (aPluginInfo.fallbackType == Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE) {
return;
}
permission = Ci.nsIPermissionManager.ALLOW_ACTION;
expireType = Ci.nsIPermissionManager.EXPIRE_TIME;
expireTime = Date.now() +
@ -707,28 +705,25 @@ var gPluginHandler = {
break;
case "block":
if (aPluginInfo.fallbackType != Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE) {
return;
}
permission = Ci.nsIPermissionManager.PROMPT_ACTION;
expireType = Ci.nsIPermissionManager.EXPIRE_NEVER;
expireTime = 0;
break;
// In case a plugin has already been allowed in another tab, the "continue allowing" button
// shouldn't change any permissions but should run the plugin-enablement code below.
case "continue":
break;
default:
Cu.reportError(Error("Unexpected plugin state: " + aNewState));
return;
}
let browser = aNotification.browser;
if (aNewState != "continue") {
Services.perms.add(browser.currentURI, aPluginInfo.permissionString,
permission, expireType, expireTime);
Services.perms.add(browser.currentURI, aPluginInfo.permissionString,
permission, expireType, expireTime);
if (aNewState == "block") {
return;
}
if (aNewState == "block") {
return;
}
// Manually activate the plugins that would have been automatically
@ -771,7 +766,8 @@ var gPluginHandler = {
fallbackType == plugin.PLUGIN_BLOCKLISTED;
});
let dismissed = notification ? notification.dismissed : true;
if (aPrimaryPlugin)
// Always show the doorhanger if the anchor is not available.
if (!isElementVisible(gURLBar) || aPrimaryPlugin)
dismissed = false;
let primaryPluginPermission = null;

View File

@ -755,7 +755,6 @@ var gBrowserInit = {
gBrowser.addEventListener("PluginCrashed", gPluginHandler, true);
gBrowser.addEventListener("PluginOutdated", gPluginHandler, true);
gBrowser.addEventListener("PluginInstantiated", gPluginHandler, true);
gBrowser.addEventListener("PluginRemoved", gPluginHandler, true);
gBrowser.addEventListener("NewPluginInstalled", gPluginHandler.newPluginInstalled, true);

View File

@ -1574,19 +1574,12 @@
this.appendChild(item);
this._items.push(item);
}
switch (this.notification.options.centerActions.length) {
case 0:
PopupNotifications._dismiss();
break;
case 1:
this._setState(this._states.SINGLE);
break;
default:
if (this.notification.options.primaryPlugin) {
this._setState(this._states.MULTI_COLLAPSED);
} else {
this._setState(this._states.MULTI_EXPANDED);
}
if (this.notification.options.centerActions.length == 1) {
this._setState(this._states.SINGLE);
} else if (this.notification.options.primaryPlugin) {
this._setState(this._states.MULTI_COLLAPSED);
} else {
this._setState(this._states.MULTI_EXPANDED);
}
]]></constructor>
<method name="_setState">
@ -1652,7 +1645,7 @@
button2 = {
label: "pluginContinue.label",
accesskey: "pluginContinue.accesskey",
action: "_singleContinue",
action: "_cancel",
default: true
};
switch (action.blocklistState) {
@ -1826,14 +1819,6 @@
this._cancel();
]]></body>
</method>
<method name="_singleContinue">
<body><![CDATA[
gPluginHandler._updatePluginPermission(this.notification,
this.notification.options.centerActions[0],
"continue");
this._cancel();
]]></body>
</method>
<method name="_multiAccept">
<body><![CDATA[
for (let item of this._items) {

View File

@ -196,36 +196,26 @@ CheckPluginStopEvent::Run()
*/
class nsSimplePluginEvent : public nsRunnable {
public:
nsSimplePluginEvent(nsIContent* aTarget, const nsAString &aEvent)
: mTarget(aTarget)
, mDocument(aTarget->GetCurrentDoc())
, mEvent(aEvent)
{
}
nsSimplePluginEvent(nsIDocument* aTarget, const nsAString& aEvent)
: mTarget(aTarget)
, mDocument(aTarget)
, mEvent(aEvent)
{
}
nsSimplePluginEvent(nsIContent* aContent, const nsAString &aEvent)
: mContent(aContent),
mEvent(aEvent)
{}
~nsSimplePluginEvent() {}
NS_IMETHOD Run();
private:
nsCOMPtr<nsISupports> mTarget;
nsCOMPtr<nsIDocument> mDocument;
nsCOMPtr<nsIContent> mContent;
nsString mEvent;
};
NS_IMETHODIMP
nsSimplePluginEvent::Run()
{
LOG(("OBJLC [%p]: nsSimplePluginEvent firing event \"%s\"", mTarget.get(),
LOG(("OBJLC [%p]: nsSimplePluginEvent firing event \"%s\"", mContent.get(),
mEvent.get()));
nsContentUtils::DispatchTrustedEvent(mDocument, mTarget,
nsContentUtils::DispatchTrustedEvent(mContent->GetDocument(), mContent,
mEvent, true, true);
return NS_OK;
}
@ -684,9 +674,7 @@ nsObjectLoadingContent::UnbindFromTree(bool aDeep, bool aNullParent)
/// would keep the docshell around, but trash the frameloader
UnloadObject();
}
nsCOMPtr<nsIRunnable> ev = new nsSimplePluginEvent(thisContent->GetCurrentDoc(),
NS_LITERAL_STRING("PluginRemoved"));
NS_DispatchToCurrentThread(ev);
}
nsObjectLoadingContent::nsObjectLoadingContent()

View File

@ -1192,11 +1192,9 @@ PluginModuleParent::NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs
uint32_t flags = 0;
if (!CallNP_Initialize(flags, error)) {
mShutdown = true;
return NS_ERROR_FAILURE;
}
else if (*error != NPERR_NO_ERROR) {
mShutdown = true;
return NS_OK;
}
@ -1222,14 +1220,8 @@ PluginModuleParent::NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error)
flags |= kAllowAsyncDrawing;
#endif
if (!CallNP_Initialize(flags, error)) {
mShutdown = true;
if (!CallNP_Initialize(flags, error))
return NS_ERROR_FAILURE;
}
if (*error != NPERR_NO_ERROR) {
mShutdown = true;
return NS_OK;
}
#if defined XP_WIN
// Send the info needed to join the chrome process's audio session to the