From bc9d7262b83a8e9b5e872d92eeb8743d89769f96 Mon Sep 17 00:00:00 2001 From: Errietta Kostala Date: Fri, 31 Jan 2014 13:59:23 -0500 Subject: [PATCH] Bug 959366 - Remove unused LazyNotificationGetter.shutdown function. r=mleibovic --- mobile/android/chrome/content/browser.js | 31 +++++------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 90e9964929fd..f67bd38f9d65 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -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 ["WebrtcUI", ["getUserMedia:request", "recording-device-events"], "chrome://browser/content/WebrtcUI.js"], @@ -125,14 +114,9 @@ var LazyNotificationGetter = { return sandbox[name]; }); notifications.forEach(function (aNotification) { - let o = { - notification: aNotification, - observe: function(s, t, d) { - window[name].observe(s, t, d); - } - }; - Services.obs.addObserver(o, aNotification, false); - LazyNotificationGetter.observers.push(o); + Services.obs.addObserver(function(s, t, d) { + window[name].observe(s, t, d) + }, aNotification, false); }); }); @@ -143,12 +127,9 @@ var LazyNotificationGetter = { let [name, notifications, resource] = module; XPCOMUtils.defineLazyModuleGetter(this, name, resource); notifications.forEach(notification => { - let o = { - notification: notification, - observe: (s, t, d) => this[name].observe(s, t, d) - }; - Services.obs.addObserver(o, notification, false); - LazyNotificationGetter.observers.push(o); + Services.obs.addObserver((s,t,d) => { + this[name].observe(s,t,d) + }, notification, false); }); });