Backout bug 742805, 742778, 742775, 740974, 742765, 742761, 742092, 722197 for leaks.
authorMs2ger <ms2ger@gmail.com>
Fri, 06 Apr 2012 13:10:30 +0200
changeset 91165 92cc2053db2f352389d2ef637457d56c9fd69eff
parent 91164 4aa132abac5a760e372fd6972a1a369ad9a0ad39
child 91166 828112609eb9cfdc9a6bffcb79635ec2989e3a09
push id8054
push userMs2ger@gmail.com
push dateFri, 06 Apr 2012 11:10:51 +0000
treeherdermozilla-inbound@92cc2053db2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs742805, 742778, 742775, 740974, 742765, 742761, 742092, 722197
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backout bug 742805, 742778, 742775, 740974, 742765, 742761, 742092, 722197 for leaks.
b2g/chrome/content/shell.js
b2g/chrome/content/shell.xul
b2g/components/ContentPermissionPrompt.js
dom/settings/SettingsManager.js
dom/sms/src/ril/SmsDatabaseService.js
dom/system/gonk/ril_worker.js
dom/wifi/DOMWifiManager.js
dom/wifi/WifiWorker.js
dom/wifi/wifi_worker.js
ipc/ril/Ril.cpp
netwerk/dns/nsDNSService2.cpp
netwerk/dns/nsDNSService2.h
netwerk/test/unit/test_dns_service.js
toolkit/content/widgets/toolbar.xml
--- a/b2g/chrome/content/shell.js
+++ b/b2g/chrome/content/shell.js
@@ -25,24 +25,18 @@ XPCOMUtils.defineLazyGetter(Services, 's
 });
 
 XPCOMUtils.defineLazyGetter(Services, 'idle', function() {
   return Cc['@mozilla.org/widget/idleservice;1']
            .getService(Ci.nsIIdleService);
 });
 
 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() {
   return Cc['@mozilla.org/focus-manager;1']
            .getService(Ci.nsFocusManager);
 });
 
 // FIXME Bug 707625
@@ -80,39 +74,40 @@ var shell = {
       let homeSrc = Services.env.get('B2G_HOMESCREEN');
       if (homeSrc)
         return homeSrc;
     } catch (e) {}
 
     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) {
       window.addEventListener(type, this, false, true);
       window.addEventListener(type, this, true, true);
     }).bind(this));
 
     window.addEventListener('MozApplicationManifest', this);
     window.addEventListener('mozfullscreenchange', this);
     window.addEventListener('sizemodechange', this);
     this.contentBrowser.addEventListener('load', this, true);
 
     // Until the volume can be set from the content side, set it to a
     // 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 {
       domains = Services.prefs.getCharPref('b2g.privileged.domains');
     } catch(e) {}
 
     addPermissions(domains.split(","));
 
@@ -297,54 +292,47 @@ var shell = {
   let power = navigator.mozPower;
   let idleHandler = function idleHandler(subject, topic, time) {
     if (topic === "idle") {
       if (power.getWakeLockState("screen") != "locked-foreground") {
         navigator.mozPower.screenEnabled = false;
       }
     }
   }
-
   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
     // might go to sleep as soon as the screen is turned off and
     // acquiring wake lock will not bring it back (actually the code
     // is not executed at all).
     if (topic == "screen") {
       if (state != "locked-foreground") {
         if (Services.idle.idleTime > idleTimeout*1000) {
           navigator.mozPower.screenEnabled = false;
         }
       } else {
         navigator.mozPower.screenEnabled = true;
       }
     }
   }
-
   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;
     if (idleTimeout) {
       Services.idle.addIdleObserver(idleHandler, idleTimeout);
       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) {
     if (e.settingName == "power.screen.timeout" && e.settingValue) {
       Services.idle.removeIdleObserver(idleHandler, idleTimeout);
       idleTimeout = e.settingValue;
       Services.idle.addIdleObserver(idleHandler, idleTimeout);
     }
@@ -432,17 +420,17 @@ Services.obs.addObserver(function onCons
   let serverPort = Services.prefs.getIntPref('b2g.remote-js.port');
   let serverSocket = Cc['@mozilla.org/network/server-socket;1']
                        .createInstance(Ci.nsIServerSocket);
   serverSocket.init(serverPort, true, -1);
   dump('Opened socket on ' + serverSocket.port + '\n');
   serverSocket.asyncListen(listener);
 })();
 
-var CustomEventManager = {
+CustomEventManager = {
   init: function custevt_init() {
     window.addEventListener("ContentStart", (function(evt) {
       content.addEventListener("mozContentEvent", this, false, true);
     }).bind(this), false);
   },
 
   handleEvent: function custevt_handleEvent(evt) {
     let detail = evt.detail;
@@ -456,17 +444,17 @@ var CustomEventManager = {
       case "webapps-install-granted":
       case "webapps-install-denied":
         WebappsHelper.handleEvent(detail);
         break;
     }
   }
 }
 
-var AlertsHelper = {
+AlertsHelper = {
   _listeners: {},
   _count: 0,
 
   handleEvent: function alert_handleEvent(detail) {
     if (!detail || !detail.id)
       return;
 
     let listener = this._listeners[detail.id];
@@ -487,17 +475,17 @@ var AlertsHelper = {
   showAlertNotification: function alert_showAlertNotification(imageUrl, title, text, textClickable, 
                                                               cookie, alertListener, name) {
     let id = this.registerListener(cookie, alertListener);
     shell.sendEvent(content, "mozChromeEvent", { type: "desktop-notification", id: id, icon: imageUrl, 
                                                  title: title, text: text } );
   }
 }
 
-var WebappsHelper = {
+WebappsHelper = {
   _installers: {},
   _count: 0,
 
   init: function webapps_init() {
     Services.obs.addObserver(this, "webapps-launch", false);
     Services.obs.addObserver(this, "webapps-ask-install", false);
   },
 
--- a/b2g/chrome/content/shell.xul
+++ b/b2g/chrome/content/shell.xul
@@ -14,16 +14,19 @@
         style="background: black; overflow: hidden;"
         onload="shell.start();"
         onunload="shell.stop();">
 
   <script type="application/javascript" src="chrome://browser/content/shell.js"/>
 #ifndef MOZ_TOUCH
   <script type="application/javascript" src="chrome://browser/content/touch.js"/>
 #endif
+#ifndef MOZ_WIDGET_GONK
+  <script type="application/javascript" src="chrome://browser/content/httpd.js"/>
+#endif
 
   <browser id="homescreen"
            type="content-primary"
            flex="1"
            style="overflow: hidden;"
-           src="data:text/html;charset=utf-8,%3C!DOCTYPE html>%3Cbody style='background:black;'>"/>
+           src="data:text/html,%3C!DOCTYPE html>%3Cbody style='background:black;'>"/>
 </window>
 
--- a/b2g/components/ContentPermissionPrompt.js
+++ b/b2g/components/ContentPermissionPrompt.js
@@ -22,45 +22,22 @@ ContentPermissionPrompt.prototype = {
     }
     if (result == Ci.nsIPermissionManager.DENY_ACTION) {
       request.cancel();
       return true;
     }
     return false;
   },
 
-  _id: 0,
   prompt: function(request) {
     // returns true if the request was handled
     if (this.handleExistingPermission(request))
        return;
 
-    let browser = Services.wm.getMostRecentWindow("navigator:browser");
-    let content = browser.content;
-    if (!content)
-      return;
-
-    let requestId = this._id++;
-    content.addEventListener("mozContentEvent", function contentEvent(evt) {
-      if (evt.detail.id != requestId)
-        return;
-
-      content.removeEventListener(evt.type, contentEvent);
-      if (evt.detail.type == "permission-allow") {
-        request.allow();
-        return;
-      }
-
-      request.cancel();
-    });
-
-    browser.shell.sendEvent(browser.content, "mozChromeEvent", {
-      "type": "permission-prompt", "permission": request.type,
-      "id": requestId, "url": request.uri.spec
-    });
+    // TODO : show UI to grant or deny permission
   },
 
   classID: Components.ID("{8c719f03-afe0-4aac-91ff-6c215895d467}"),
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentPermissionPrompt])
 };
 
 
--- a/dom/settings/SettingsManager.js
+++ b/dom/settings/SettingsManager.js
@@ -59,17 +59,17 @@ SettingsDB.prototype = {
    */
   ensureDB: function ensureDB(aSuccessCb, aFailureCb, aGlobal) {
     if (this.db) {
       debug("ensureDB: already have a database, returning early.");
       return;
     }
 
     let self = this;
-    debug("try to open database:" + DB_NAME + " " + DB_VERSION + " " + this.db);
+    debug("try to open database:" + DB_NAME + " " + DB_VERSION + " " + this._indexedDB);
     let req = aGlobal.mozIndexedDB.open(DB_NAME, DB_VERSION);
     req.onsuccess = function (event) {
       debug("Opened database:", DB_NAME, DB_VERSION);
       self.db = event.target.result;
       self.db.onversionchange = function(event) {
         debug("WARNING: DB modified from a different window.");
       }
       aSuccessCb();
--- a/dom/sms/src/ril/SmsDatabaseService.js
+++ b/dom/sms/src/ril/SmsDatabaseService.js
@@ -6,17 +6,17 @@
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 const RIL_SMSDATABASESERVICE_CONTRACTID = "@mozilla.org/sms/rilsmsdatabaseservice;1";
 const RIL_SMSDATABASESERVICE_CID = Components.ID("{a1fa610c-eb6c-4ac2-878f-b005d5e89249}");
 
-const DEBUG = false;
+const DEBUG = true;
 const DB_NAME = "sms";
 const DB_VERSION = 1;
 const STORE_NAME = "sms";
 
 const DELIVERY_SENT = "sent";
 const DELIVERY_RECEIVED = "received";
 
 const FILTER_TIMESTAMP = "timestamp";
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -1918,17 +1918,17 @@ RIL[REQUEST_SIGNAL_STRENGTH] = function 
                        signalStrength: obj});
 };
 RIL[REQUEST_VOICE_REGISTRATION_STATE] = function REQUEST_VOICE_REGISTRATION_STATE(length, options) {
   if (options.rilRequestError) {
     return;
   }
 
   let state = Buf.readStringList();
-  if (DEBUG) debug("voice registration state: " + state);
+debug("voice registration state: " + state);
   this._processVoiceRegistrationState(state);
 };
 RIL[REQUEST_DATA_REGISTRATION_STATE] = function REQUEST_DATA_REGISTRATION_STATE(length, options) {
   if (options.rilRequestError) {
     return;
   }
 
   let state = Buf.readStringList();
@@ -2042,21 +2042,19 @@ RIL[REQUEST_SIM_IO] = function REQUEST_S
     return;
   }
 
   let sw1 = Buf.readUint32();
   let sw2 = Buf.readUint32();
   if (sw1 != ICC_STATUS_NORMAL_ENDING) {
     // See GSM11.11, TS 51.011 clause 9.4, and ISO 7816-4 for the error
     // description.
-    if (DEBUG) {
-      debug("ICC I/O Error EF id = " + options.fileid.toString(16) +
-            " command = " + options.command.toString(16) +
-            "(" + sw1.toString(16) + "/" + sw2.toString(16) + ")");
-    }
+    debug("ICC I/O Error EF id = " + options.fileid.toString(16) +
+          " command = " + options.command.toString(16) +
+          "(" + sw1.toString(16) + "/" + sw2.toString(16) + ")");
     return;
   }
 
   switch (options.fileid) {
     case ICC_EF_MSISDN:
       this._processMSISDNResponse(options);
       break;
   }
--- a/dom/wifi/DOMWifiManager.js
+++ b/dom/wifi/DOMWifiManager.js
@@ -7,17 +7,17 @@
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/DOMRequestHelper.jsm");
 
-const DEBUG = false; // set to false to suppress debug messages
+const DEBUG = true; // set to false to suppress debug messages
 
 const DOMWIFIMANAGER_CONTRACTID = "@mozilla.org/wifimanager;1";
 const DOMWIFIMANAGER_CID        = Components.ID("{2cf775a7-1837-410c-9e26-323c42e076da}");
 
 function DOMWifiManager() {
 }
 
 DOMWifiManager.prototype = {
--- a/dom/wifi/WifiWorker.js
+++ b/dom/wifi/WifiWorker.js
@@ -39,17 +39,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
-const DEBUG = false; // set to false to suppress debug messages
+const DEBUG = true; // set to false to suppress debug messages
 
 const WIFIWORKER_CONTRACTID = "@mozilla.org/wifi/worker;1";
 const WIFIWORKER_CID        = Components.ID("{a14e8977-d259-433a-a88d-58dd44657e5b}");
 
 const WIFIWORKER_WORKER     = "resource://gre/modules/wifi_worker.js";
 
 // A note about errors and error handling in this file:
 // The libraries that we use in this file are intended for C code. For
--- a/dom/wifi/wifi_worker.js
+++ b/dom/wifi/wifi_worker.js
@@ -8,27 +8,16 @@
 
 importScripts("libhardware_legacy.js", "systemlibs.js");
 
 var cbuf = ctypes.char.array(4096)();
 var hwaddr = ctypes.uint8_t.array(6)();
 var len = ctypes.size_t();
 var ints = ctypes.int.array(8)();
 
-const DEBUG = false;
-
-let debug;
-if (DEBUG) {
-  debug = function (s) {
-    dump("-*- WifiWorker component: " + s + "\n");
-  };
-} else {
-  debug = function (s) {};
-}
-
 // TODO: consolidate with implementation in systemlibs.js
 let libcutils = (function () {
   let library = ctypes.open("libcutils.so");
 
   return {
     property_get: library.declare("property_get", ctypes.default_abi, ctypes.int, ctypes.char.ptr, ctypes.char.ptr, ctypes.char.ptr),
     property_set: library.declare("property_set", ctypes.default_abi, ctypes.int, ctypes.char.ptr, ctypes.char.ptr)
   };
@@ -73,17 +62,17 @@ self.onmessage = function(e) {
     postMessage({ id: id, route: route });
     break;
   case "ifc_add_host_route":
   case "ifc_set_default_route":
     var ret = libnetutils[cmd](data.ifname, data.route);
     postMessage({ id: id, status: ret });
     break;
   case "ifc_configure":
-    debug("WIFI: data: " + uneval(data) + "\n");
+    dump("WIFI: data: " + uneval(data) + "\n");
     var ret = libnetutils.ifc_configure(data.ifname, data.ipaddr, data.mask, data.gateway, data.dns1, data.dns2);
     postMessage({ id: id, status: ret });
     break;
   case "dhcp_get_errmsg":
     var error = libnetutils.get_dhcp_get_errmsg();
     postMessage({ id: id, error: error.readString() });
     break;
   case "dhcp_do_request":
@@ -99,13 +88,13 @@ self.onmessage = function(e) {
     break;
   case "property_set":
     var ret = libcutils.property_set(data.key, data.value);
     postMessage({ id: id, status: ret });
     break;
   default:
     var f = libhardware_legacy[cmd] || libnetutils[cmd];
     var ret = f();
-    debug("WIFI: " + cmd + " returned: " + ret);
+    dump("WIFI: " + cmd + " returned: " + ret);
     postMessage({ id: id, status: ret });
     break;
   }
 }
--- a/ipc/ril/Ril.cpp
+++ b/ipc/ril/Ril.cpp
@@ -224,19 +224,17 @@ RilClient::OpenSocket()
 #endif
 
     if (mSocket.mFd < 0) {
         LOG("Cannot create socket for RIL!\n");
         return false;
     }
 
     if (connect(mSocket.mFd, (struct sockaddr *) &addr, alen) < 0) {
-#if defined(MOZ_WIDGET_GONK)
         LOG("Cannot open socket for RIL!\n");
-#endif
         close(mSocket.mFd);
         return false;
     }
 
     // Set close-on-exec bit.
     int flags = fcntl(mSocket.mFd, F_GETFD);
     if (-1 == flags) {
         return false;
--- a/netwerk/dns/nsDNSService2.cpp
+++ b/netwerk/dns/nsDNSService2.cpp
@@ -52,30 +52,28 @@
 #include "nsThreadUtils.h"
 #include "nsIProtocolProxyService.h"
 #include "prsystem.h"
 #include "prnetdb.h"
 #include "prmon.h"
 #include "prio.h"
 #include "plstr.h"
 #include "nsIOService.h"
-#include "nsCharSeparatedTokenizer.h"
 
 #include "mozilla/FunctionTimer.h"
 
 using namespace mozilla;
 
 static const char kPrefDnsCacheEntries[]    = "network.dnsCacheEntries";
 static const char kPrefDnsCacheExpiration[] = "network.dnsCacheExpiration";
 static const char kPrefDnsCacheGrace[]      = "network.dnsCacheExpirationGracePeriod";
 static const char kPrefEnableIDN[]          = "network.enableIDN";
 static const char kPrefIPv4OnlyDomains[]    = "network.dns.ipv4OnlyDomains";
 static const char kPrefDisableIPv6[]        = "network.dns.disableIPv6";
 static const char kPrefDisablePrefetch[]    = "network.dns.disablePrefetch";
-static const char kPrefDnsLocalDomains[]    = "network.dns.localDomains";
 
 //-----------------------------------------------------------------------------
 
 class nsDNSRecord : public nsIDNSRecord
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIDNSRECORD
@@ -403,53 +401,48 @@ nsDNSService::Init()
     PRUint32 maxCacheLifetime = 2; // minutes
     PRUint32 lifetimeGracePeriod = 1;
     bool     enableIDN        = true;
     bool     disableIPv6      = false;
     bool     disablePrefetch  = false;
     int      proxyType        = nsIProtocolProxyService::PROXYCONFIG_DIRECT;
     
     nsAdoptingCString ipv4OnlyDomains;
-    nsAdoptingCString localDomains;
 
     // read prefs
     nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
     if (prefs) {
         PRInt32 val;
         if (NS_SUCCEEDED(prefs->GetIntPref(kPrefDnsCacheEntries, &val)))
             maxCacheEntries = (PRUint32) val;
         if (NS_SUCCEEDED(prefs->GetIntPref(kPrefDnsCacheExpiration, &val)))
             maxCacheLifetime = val / 60; // convert from seconds to minutes
         if (NS_SUCCEEDED(prefs->GetIntPref(kPrefDnsCacheGrace, &val)))
             lifetimeGracePeriod = val / 60; // convert from seconds to minutes
 
         // ASSUMPTION: pref branch does not modify out params on failure
         prefs->GetBoolPref(kPrefEnableIDN, &enableIDN);
         prefs->GetBoolPref(kPrefDisableIPv6, &disableIPv6);
         prefs->GetCharPref(kPrefIPv4OnlyDomains, getter_Copies(ipv4OnlyDomains));
-        prefs->GetCharPref(kPrefDnsLocalDomains, getter_Copies(localDomains));
         prefs->GetBoolPref(kPrefDisablePrefetch, &disablePrefetch);
 
         // If a manual proxy is in use, disable prefetch implicitly
         prefs->GetIntPref("network.proxy.type", &proxyType);
     }
 
     if (mFirstTime) {
         mFirstTime = false;
 
-        mLocalDomains.Init();
-
         // register as prefs observer
         if (prefs) {
             prefs->AddObserver(kPrefDnsCacheEntries, this, false);
             prefs->AddObserver(kPrefDnsCacheExpiration, this, false);
             prefs->AddObserver(kPrefDnsCacheGrace, this, false);
             prefs->AddObserver(kPrefEnableIDN, this, false);
             prefs->AddObserver(kPrefIPv4OnlyDomains, this, false);
-            prefs->AddObserver(kPrefDnsLocalDomains, this, false);
             prefs->AddObserver(kPrefDisableIPv6, this, false);
             prefs->AddObserver(kPrefDisablePrefetch, this, false);
 
             // Monitor these to see if there is a change in proxy configuration
             // If a manual proxy is in use, disable prefetch implicitly
             prefs->AddObserver("network.proxy.type", this, false);
         }
     }
@@ -477,29 +470,16 @@ nsDNSService::Init()
         MutexAutoLock lock(mLock);
         mResolver = res;
         mIDN = idn;
         mIPv4OnlyDomains = ipv4OnlyDomains; // exchanges buffer ownership
         mDisableIPv6 = disableIPv6;
 
         // Disable prefetching either by explicit preference or if a manual proxy is configured 
         mDisablePrefetch = disablePrefetch || (proxyType == nsIProtocolProxyService::PROXYCONFIG_MANUAL);
-
-        mLocalDomains.Clear();
-        if (localDomains) {
-            nsAdoptingString domains;
-            domains.AssignASCII(nsDependentCString(localDomains).get());
-            nsCharSeparatedTokenizer tokenizer(domains, ',',
-                                               nsCharSeparatedTokenizerTemplate<>::SEPARATOR_OPTIONAL);
- 
-            while (tokenizer.hasMoreTokens()) {
-                const nsSubstring& domain = tokenizer.nextToken();
-                mLocalDomains.PutEntry(nsDependentCString(NS_ConvertUTF16toUTF8(domain).get()));
-            }
-        }
     }
     return rv;
 }
 
 NS_IMETHODIMP
 nsDNSService::Shutdown()
 {
     nsRefPtr<nsHostResolver> res;
@@ -592,41 +572,34 @@ nsDNSService::AsyncResolve(const nsACStr
                            nsIDNSListener    *listener,
                            nsIEventTarget    *target,
                            nsICancelable    **result)
 {
     // grab reference to global host resolver and IDN service.  beware
     // simultaneous shutdown!!
     nsRefPtr<nsHostResolver> res;
     nsCOMPtr<nsIIDNService> idn;
-    bool localDomain = false;
     {
         MutexAutoLock lock(mLock);
 
         if (mDisablePrefetch && (flags & RESOLVE_SPECULATE))
             return NS_ERROR_DNS_LOOKUP_QUEUE_FULL;
 
         res = mResolver;
         idn = mIDN;
-        localDomain = mLocalDomains.GetEntry(hostname);
     }
     if (!res)
         return NS_ERROR_OFFLINE;
 
     const nsACString *hostPtr = &hostname;
 
-    static const nsCString localhost((const char *) "localhost");
-    if (localDomain) {
-        hostPtr = &localhost;
-    }
-
     nsresult rv;
     nsCAutoString hostACE;
-    if (idn && !IsASCII(*hostPtr)) {
-        if (NS_SUCCEEDED(idn->ConvertUTF8toACE(*hostPtr, hostACE)))
+    if (idn && !IsASCII(hostname)) {
+        if (NS_SUCCEEDED(idn->ConvertUTF8toACE(hostname, hostACE)))
             hostPtr = &hostACE;
     }
 
     if (target) {
       listener = new DNSListenerProxy(listener, target);
     }
 
     PRUint16 af = GetAFForLookup(*hostPtr, flags);
@@ -687,36 +660,29 @@ NS_IMETHODIMP
 nsDNSService::Resolve(const nsACString &hostname,
                       PRUint32          flags,
                       nsIDNSRecord    **result)
 {
     // grab reference to global host resolver and IDN service.  beware
     // simultaneous shutdown!!
     nsRefPtr<nsHostResolver> res;
     nsCOMPtr<nsIIDNService> idn;
-    bool localDomain = false;
     {
         MutexAutoLock lock(mLock);
         res = mResolver;
         idn = mIDN;
-        localDomain = mLocalDomains.GetEntry(hostname);
     }
     NS_ENSURE_TRUE(res, NS_ERROR_OFFLINE);
 
     const nsACString *hostPtr = &hostname;
 
-    static const nsCString localhost((const char *) "localhost");
-    if (localDomain) {
-        hostPtr = &localhost;
-    }
-
     nsresult rv;
     nsCAutoString hostACE;
-    if (idn && !IsASCII(*hostPtr)) {
-        if (NS_SUCCEEDED(idn->ConvertUTF8toACE(*hostPtr, hostACE)))
+    if (idn && !IsASCII(hostname)) {
+        if (NS_SUCCEEDED(idn->ConvertUTF8toACE(hostname, hostACE)))
             hostPtr = &hostACE;
     }
 
     //
     // sync resolve: since the host resolver only works asynchronously, we need
     // to use a mutex and a condvar to wait for the result.  however, since the
     // result may be in the resolvers cache, we might get called back recursively
     // on the same thread.  so, our mutex needs to be re-entrant.  in other words,
--- a/netwerk/dns/nsDNSService2.h
+++ b/netwerk/dns/nsDNSService2.h
@@ -35,18 +35,16 @@
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsPIDNSService.h"
 #include "nsIIDNService.h"
 #include "nsIObserver.h"
 #include "nsHostResolver.h"
 #include "nsAutoPtr.h"
 #include "nsString.h"
-#include "nsTHashtable.h"
-#include "nsHashKeys.h"
 #include "mozilla/Mutex.h"
 
 class nsDNSService : public nsPIDNSService
                    , public nsIObserver
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSPIDNSSERVICE
@@ -67,10 +65,9 @@ private:
 
     // mIPv4OnlyDomains is a comma-separated list of domains for which only
     // IPv4 DNS lookups are performed. This allows the user to disable IPv6 on
     // a per-domain basis and work around broken DNS servers. See bug 68796.
     nsAdoptingCString         mIPv4OnlyDomains;
     bool                      mDisableIPv6;
     bool                      mDisablePrefetch;
     bool                      mFirstTime;
-    nsTHashtable<nsCStringHashKey> mLocalDomains;
 };
--- a/netwerk/test/unit/test_dns_service.js
+++ b/netwerk/test/unit/test_dns_service.js
@@ -1,27 +1,7 @@
 function run_test() {
-  check_localhost();
-  check_local_redirect();
-}
-
-function check_localhost() {
   var dns = Components.classes["@mozilla.org/network/dns-service;1"]
                       .getService(Components.interfaces.nsIDNSService);
   var rec = dns.resolve("localhost", 0);
   var answer = rec.getNextAddrAsString();
   do_check_true(answer == "127.0.0.1" || answer == "::1");
 }
-
-function check_local_redirect() {
-  var prefs = Components.classes["@mozilla.org/preferences-service;1"]
-                        .getService(Components.interfaces.nsIPrefBranch);
-  prefs.setCharPref("network.dns.localDomains", "local.vingtetun.org");
-
-  var dns = Components.classes["@mozilla.org/network/dns-service;1"]
-                      .getService(Components.interfaces.nsIDNSService);
-  var rec = dns.resolve("local.vingtetun.org", 0);
-  var answer = rec.getNextAddrAsString();
-  do_check_true(answer == "127.0.0.1" || answer == "::1");
-
-  prefs.clearUserPref("network.dns.localDomains");
-}
-
--- a/toolkit/content/widgets/toolbar.xml
+++ b/toolkit/content/widgets/toolbar.xml
@@ -220,17 +220,17 @@
 
             return currentSet.join(",") || "__empty";
           ]]>
         </getter>
 
         <setter>
           <![CDATA[
             if (val == this.currentSet)
-              return val;
+              return;
 
             var ids = (val == "__empty") ? [] : val.split(",");
 
             var nodeidx = 0;
             var paletteItems = { }, added = { };
 
             var palette = this.toolbox ? this.toolbox.palette : null;