Bug 1306397 - Remove B2G event 'network-active-changed' and consumers from non-B2G/Gonk files: dom/presentation. r=schien
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 29 Sep 2016 19:53:44 +0200
changeset 361492 42f0050c38d1697d006c182ccf50c8d9a568f55c
parent 361491 2fae37a9ffe6e5e4f63dbb3f91f30c9ef8b88d45
child 361493 a1fbfc8724824632069cc4be36bad63fa74842d7
push id1369
push userjlorenzo@mozilla.com
push dateMon, 27 Feb 2017 14:59:41 +0000
treeherdermozilla-release@d75a1dba431f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersschien
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: dom/presentation. r=schien MozReview-Commit-ID: 1tTdMntEo54
dom/presentation/provider/PresentationControlService.js
--- a/dom/presentation/provider/PresentationControlService.js
+++ b/dom/presentation/provider/PresentationControlService.js
@@ -113,18 +113,16 @@ PresentationControlService.prototype = {
       throw Cr.NS_ERROR_FAILURE;
     }
 
     this._port = this._serverSocket.port;
 
     DEBUG && log("PresentationControlService - service start on port: " + this._port); // jshint ignore:line
 
     // Monitor network interface change to restart server socket.
-    // Only B2G has nsINetworkManager
-    Services.obs.addObserver(this, "network-active-changed", false);
     Services.obs.addObserver(this, "network:offline-status-changed", false);
 
     this._notifyServerReady();
   },
 
   _notifyServerReady: function() {
     Services.tm.mainThread.dispatch(() => {
       if (this._listener) {
@@ -319,43 +317,27 @@ PresentationControlService.prototype = {
 
   close: function() {
     DEBUG && log("PresentationControlService - close"); // jshint ignore:line
     if (this._isServiceInit()) {
       DEBUG && log("PresentationControlService - close server socket"); // jshint ignore:line
       this._serverSocket.close();
       this._serverSocket = null;
 
-      Services.obs.removeObserver(this, "network-active-changed");
       Services.obs.removeObserver(this, "network:offline-status-changed");
 
       this._notifyServerStopped(Cr.NS_OK);
     }
     this._port = 0;
   },
 
   // nsIObserver
   observe: function(aSubject, aTopic, aData) {
     DEBUG && log("PresentationControlService - observe: " + aTopic); // jshint ignore:line
     switch (aTopic) {
-      case "network-active-changed": {
-        if (!aSubject) {
-          DEBUG && log("No active network"); // jshint ignore:line
-          return;
-        }
-
-        /**
-         * Restart service only when original status is online because other
-         * cases will be handled by "network:offline-status-changed".
-         */
-        if (!Services.io.offline) {
-          this._restartServer();
-        }
-        break;
-      }
       case "network:offline-status-changed": {
         if (aData == "offline") {
           DEBUG && log("network offline"); // jshint ignore:line
           return;
         }
         this._restartServer();
         break;
       }