Bug 1173523 - Part 13: Update SpecialPowers to use new API for nsIPermission, r=jmaher

This commit is contained in:
Michael Layzell 2015-06-10 11:54:21 -04:00 committed by Ehsan Akhgari
parent 810f32e7e1
commit a539205fa0
2 changed files with 11 additions and 2 deletions

View File

@ -217,7 +217,16 @@ SpecialPowersObserver.prototype = new SpecialPowersObserverAPI();
switch (aTopic) {
case "perm-changed":
var permission = aSubject.QueryInterface(Ci.nsIPermission);
msg.permission = { appId: permission.appId, type: permission.type };
// specialPowersAPI will consume this value, and it is used as a
// fake permission, but only type and principal.appId will be used.
//
// We need to ensure that it looks the same as a real permission,
// so we fake these properties.
msg.permission = {
principal: { appId: permission.principal.appId },
type: permission.type
};
default:
this._self._sendAsyncMessage("specialpowers-" + aTopic, msg);
}

View File

@ -967,7 +967,7 @@ SpecialPowersAPI.prototype = {
for (var j = 0; j < undos.length; j++) {
var undo = undos[j];
if (undo.op == this._obsDataMap[aData] &&
undo.appId == permission.appId &&
undo.appId == permission.principal.appId &&
undo.type == permission.type) {
// Remove this undo item if it has been done by others(not
// specialpowers itself.)