Bug 1241983 - Make DOM Identity observe inner-window-destroyed not dom-window-destroyed; r=ferjm

This commit is contained in:
Kyle Machulis 2016-01-26 13:46:22 -08:00
Родитель c3817f9f6b
Коммит 2548ea3c35
1 изменённых файлов: 4 добавлений и 4 удалений

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

@ -650,14 +650,14 @@ nsDOMIdentity.prototype = {
*/
// nsIObserver
observe: function nsDOMIdentityInternal_observe(aSubject, aTopic, aData) {
let window = aSubject.QueryInterface(Ci.nsIDOMWindow);
if (window != this._window) {
let wId = aSubject.QueryInterface(Ci.nsISupportsPRUint64).data;
if (wId != this._innerWindowID) {
return;
}
this.uninit();
Services.obs.removeObserver(this, "dom-window-destroyed");
Services.obs.removeObserver(this, "inner-window-destroyed");
this._initializeState();
// TODO: Also send message to DOMIdentity notifiying window is no longer valid
@ -729,7 +729,7 @@ nsDOMIdentity.prototype = {
}, this);
// Setup observers so we can remove message listeners.
Services.obs.addObserver(this, "dom-window-destroyed", false);
Services.obs.addObserver(this, "inner-window-destroyed", false);
},
uninit: function DOMIdentity_uninit() {