Bug 488806 - network geolocation can spam server. r/sr=jst
authorDoug Turner <dougt@meer.net>
Fri, 17 Apr 2009 09:28:14 -0700
changeset 27437 9e06217fc471
parent 27436 ab9bed26019e
child 27438 4aed53dcf692
push id6558
push userdougt@mozilla.com
push date2009-04-17 16:30 +0000
treeherdermozilla-central@9e06217fc471 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs488806
milestone1.9.2a1pre
Bug 488806 - network geolocation can spam server. r/sr=jst
dom/src/geolocation/NetworkGeolocationProvider.js
--- a/dom/src/geolocation/NetworkGeolocationProvider.js
+++ b/dom/src/geolocation/NetworkGeolocationProvider.js
@@ -132,21 +132,22 @@ WifiGeoPositionProvider.prototype = {
     isReady:         function() {
         LOG("isReady called");
         return true
     },
   
     watch: function(c) {
         LOG("watch called");
 
-        if (!this.wifi_service)
+        if (!this.wifi_service) {
             this.wifi_service = Cc["@mozilla.org/wifi/monitor;1"].getService(Components.interfaces.nsIWifiMonitor);
         
-        this.wifi_service.startWatching(this);
-        this.update = c;
+            this.wifi_service.startWatching(this);
+            this.update = c;
+        }
     },
 
     shutdown: function() { 
         LOG("shutdown  called");
         if(this.wifi_service)
             this.wifi_service.stopWatching(this);
         this.update = null;