From 67cc85db28ff398f614061c7bccf5fd57b590c39 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 6 Apr 2012 13:10:30 +0200 Subject: [PATCH] Backout bug 742805, 742778, 742775, 740974, 742765, 742761, 742092, 722197 for leaks. --- b2g/chrome/content/shell.js | 28 +++++---------- b2g/chrome/content/shell.xul | 5 ++- b2g/components/ContentPermissionPrompt.js | 25 +------------- dom/settings/SettingsManager.js | 2 +- dom/sms/src/ril/SmsDatabaseService.js | 2 +- dom/system/gonk/ril_worker.js | 10 +++--- dom/wifi/DOMWifiManager.js | 2 +- dom/wifi/WifiWorker.js | 2 +- dom/wifi/wifi_worker.js | 15 ++------ ipc/ril/Ril.cpp | 2 -- netwerk/dns/nsDNSService2.cpp | 42 +++-------------------- netwerk/dns/nsDNSService2.h | 3 -- netwerk/test/unit/test_dns_service.js | 20 ----------- toolkit/content/widgets/toolbar.xml | 2 +- 14 files changed, 28 insertions(+), 132 deletions(-) diff --git a/b2g/chrome/content/shell.js b/b2g/chrome/content/shell.js index aacc8c9e3fdd..0825cdd3bd4e 100644 --- a/b2g/chrome/content/shell.js +++ b/b2g/chrome/content/shell.js @@ -30,14 +30,8 @@ XPCOMUtils.defineLazyGetter(Services, 'idle', function() { }); XPCOMUtils.defineLazyGetter(Services, 'audioManager', function() { -#ifdef MOZ_WIDGET_GONK return Cc['@mozilla.org/telephony/audiomanager;1'] .getService(Ci.nsIAudioManager); -#else - return { - "masterVolume": 0 - }; -#endif }); XPCOMUtils.defineLazyServiceGetter(Services, 'fm', function() { @@ -85,12 +79,11 @@ var shell = { return Services.prefs.getCharPref('browser.homescreenURL'); }, - start: function shell_start() { + start: function shell_init() { let homeURL = this.homeURL; if (!homeURL) { let msg = 'Fatal error during startup: No homescreen found: try setting B2G_HOMESCREEN'; - alert(msg); - return; + return alert(msg); } ['keydown', 'keypress', 'keyup'].forEach((function listenKey(type) { @@ -107,7 +100,9 @@ var shell = { // a specific value when the device starts. This way the front-end // can display a notification when the volume change and show a volume // level modified from this point. - Services.audioManager.masterVolume = 0.5; + try { + Services.audioManager.masterVolume = 0.5; + } catch(e) {} let domains = ""; try { @@ -302,7 +297,6 @@ var shell = { } } } - let wakeLockHandler = function wakeLockHandler(topic, state) { // Turn off the screen when no one needs the it or all of them are // invisible, otherwise turn the screen on. Note that the CPU @@ -319,11 +313,7 @@ var shell = { } } } - let idleTimeout = Services.prefs.getIntPref("power.screen.timeout"); - if (!('mozSettings' in navigator)) - return; - let request = navigator.mozSettings.getLock().get("power.screen.timeout"); request.onsuccess = function onSuccess() { idleTimeout = request.result["power.screen.timeout"] || idleTimeout; @@ -332,14 +322,12 @@ var shell = { power.addWakeLockListener(wakeLockHandler); } } - request.onerror = function onError() { if (idleTimeout) { Services.idle.addIdleObserver(idleHandler, idleTimeout); power.addWakeLockListener(wakeLockHandler); } } - // XXX We may override other's callback here, but this is the only // user of mozSettings in shell.js at this moment. navigator.mozSettings.onsettingchange = function onSettingChange(e) { @@ -437,7 +425,7 @@ Services.obs.addObserver(function onConsoleAPILogEvent(subject, topic, data) { serverSocket.asyncListen(listener); })(); -var CustomEventManager = { +CustomEventManager = { init: function custevt_init() { window.addEventListener("ContentStart", (function(evt) { content.addEventListener("mozContentEvent", this, false, true); @@ -461,7 +449,7 @@ var CustomEventManager = { } } -var AlertsHelper = { +AlertsHelper = { _listeners: {}, _count: 0, @@ -492,7 +480,7 @@ var AlertsHelper = { } } -var WebappsHelper = { +WebappsHelper = { _installers: {}, _count: 0, diff --git a/b2g/chrome/content/shell.xul b/b2g/chrome/content/shell.xul index 222a8172e7a9..d4e623a565e0 100644 --- a/b2g/chrome/content/shell.xul +++ b/b2g/chrome/content/shell.xul @@ -19,11 +19,14 @@ #ifndef MOZ_TOUCH