Merge m-c to inbound. Again. For great justice.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 28 Aug 2012 16:54:18 -0400
changeset 105745 2464ccbf691f1dc08f219ff83ea392eaaeecb6e7
parent 105744 e3adff2d69d789fe1fdd39615bda88a13810f370 (current diff)
parent 105680 9e267fbca9fb42fe17e199bc83c44f79b1333107 (diff)
child 105746 7676fb4f1828de944dee311d2a841b25ebfa3241
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
milestone18.0a1
Merge m-c to inbound. Again. For great justice.
dom/wifi/WifiWorker.js
--- a/dom/wifi/WifiWorker.js
+++ b/dom/wifi/WifiWorker.js
@@ -2020,33 +2020,20 @@ WifiWorker.prototype = {
 
   getNetworks: function(msg) {
     const message = "WifiManager:getNetworks:Return";
     if (!WifiManager.enabled) {
       this._sendMessage(message, false, "Wifi is disabled", msg);
       return;
     }
 
-    let callback = (function (networks) {
+    this.waitForScan((function (networks) {
       this._sendMessage(message, networks !== null, networks, msg);
-    }).bind(this);
-    this.waitForScan(callback);
-
-    WifiManager.scan(true, (function(ok) {
-      // If the scan command succeeded, we're done.
-      if (ok)
-        return;
-
-      // Avoid sending multiple responses.
-      this.wantScanResults.splice(this.wantScanResults.indexOf(callback), 1);
-
-      // Otherwise, let the client know that it failed, it's responsible for
-      // trying again in a few seconds.
-      this._sendMessage(message, false, "ScanFailed", msg);
     }).bind(this));
+    WifiManager.scan(true, function() {});
   },
 
   _notifyAfterStateChange: function(success, newState) {
     // First, notify all of the requests that were trying to make this change.
     let state = this._stateRequests[0].enabled;
 
     // If the new state is not the same as state, then we weren't processing
     // the first request (we were racing somehow) so don't notify.