Bug 1306397 - Remove B2G event 'network-active-changed' and consumers from non-B2G/Gonk files: devtools. r=jryans
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 29 Sep 2016 19:53:44 +0200
changeset 316391 a1fbfc8724824632069cc4be36bad63fa74842d7
parent 316390 42f0050c38d1697d006c182ccf50c8d9a568f55c
child 316392 86a18cc7342ed294fd304f56f7e9f4b2c4e3739f
push id30770
push userkwierso@gmail.com
push dateWed, 05 Oct 2016 00:00:48 +0000
treeherdermozilla-central@3470e326025c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1306397
milestone52.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
Bug 1306397 - Remove B2G event 'network-active-changed' and consumers from non-B2G/Gonk files: devtools. r=jryans MozReview-Commit-ID: 2qoD29sZvSQ
devtools/shared/discovery/discovery.js
--- a/devtools/shared/discovery/discovery.js
+++ b/devtools/shared/discovery/discovery.js
@@ -255,18 +255,16 @@ function Discovery() {
   };
   this._expectingReplies = {
     from: new Set()
   };
 
   this._onRemoteScan = this._onRemoteScan.bind(this);
   this._onRemoteUpdate = this._onRemoteUpdate.bind(this);
   this._purgeMissingDevices = this._purgeMissingDevices.bind(this);
-
-  Services.obs.addObserver(this, "network-active-changed", false);
 }
 
 Discovery.prototype = {
 
   /**
    * Add a new service offered by this device.
    * @param service string
    *        Name of the service
@@ -375,34 +373,16 @@ Discovery.prototype = {
     if (!this._transports.update) {
       return; // Not listening
     }
     this._transports.update.off("message", this._onRemoteUpdate);
     this._transports.update.destroy();
     this._transports.update = null;
   },
 
-  observe: function (subject, topic, data) {
-    if (topic !== "network-active-changed") {
-      return;
-    }
-    let activeNetworkInfo = subject;
-    if (!activeNetworkInfo) {
-      log("No active network info");
-      return;
-    }
-    activeNetworkInfo = activeNetworkInfo.QueryInterface(Ci.nsINetworkInfo);
-    log("Active network changed to: " + activeNetworkInfo.type);
-    // UDP sockets go down when the device goes offline, so we'll restart them
-    // when the active network goes back to WiFi.
-    if (activeNetworkInfo.type === Ci.nsINetworkInfo.NETWORK_TYPE_WIFI) {
-      this._restartListening();
-    }
-  },
-
   _restartListening: function () {
     if (this._transports.scan) {
       this._stopListeningForScan();
       this._startListeningForScan();
     }
     if (this._transports.update) {
       this._stopListeningForUpdate();
       this._startListeningForUpdate();