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 коммит произвёл Ehsan Akhgari
Родитель 5588333939
Коммит a214a150be
2 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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.)