Bug 959366 - Remove unused LazyNotificationGetter.shutdown function. r=mleibovic

This commit is contained in:
Errietta Kostala 2014-01-31 13:59:23 -05:00
Родитель 7a1e060cc8
Коммит bc9d7262b8
1 изменённых файлов: 6 добавлений и 25 удалений

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

@ -95,17 +95,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "WebappManager",
}); });
}); });
// Lazily-loaded browser scripts that use observer notifcations:
var LazyNotificationGetter = {
observers: [],
shutdown: function lng_shutdown() {
this.observers.forEach(function(o) {
Services.obs.removeObserver(o, o.notification);
});
this.observers = [];
}
};
[ [
#ifdef MOZ_WEBRTC #ifdef MOZ_WEBRTC
["WebrtcUI", ["getUserMedia:request", "recording-device-events"], "chrome://browser/content/WebrtcUI.js"], ["WebrtcUI", ["getUserMedia:request", "recording-device-events"], "chrome://browser/content/WebrtcUI.js"],
@ -125,14 +114,9 @@ var LazyNotificationGetter = {
return sandbox[name]; return sandbox[name];
}); });
notifications.forEach(function (aNotification) { notifications.forEach(function (aNotification) {
let o = { Services.obs.addObserver(function(s, t, d) {
notification: aNotification, window[name].observe(s, t, d)
observe: function(s, t, d) { }, aNotification, false);
window[name].observe(s, t, d);
}
};
Services.obs.addObserver(o, aNotification, false);
LazyNotificationGetter.observers.push(o);
}); });
}); });
@ -143,12 +127,9 @@ var LazyNotificationGetter = {
let [name, notifications, resource] = module; let [name, notifications, resource] = module;
XPCOMUtils.defineLazyModuleGetter(this, name, resource); XPCOMUtils.defineLazyModuleGetter(this, name, resource);
notifications.forEach(notification => { notifications.forEach(notification => {
let o = { Services.obs.addObserver((s,t,d) => {
notification: notification, this[name].observe(s,t,d)
observe: (s, t, d) => this[name].observe(s, t, d) }, notification, false);
};
Services.obs.addObserver(o, notification, false);
LazyNotificationGetter.observers.push(o);
}); });
}); });