Bug 1307491 - (Part 4) Remove support for per-app-offline in PeerConnection.js [nukeb2g] r=jesup draft
authorValentin Gosu <valentin.gosu@gmail.com>
Mon, 17 Oct 2016 03:59:02 +0200
changeset 425992 a2d3d44970d17ef6f679adeed4f043c99b250744
parent 425991 91060bc89aa8e76e2e06d848a9e7297c171dd85b
child 425993 1b1eeed587600316a3cb10512cbd5f5182de3f2d
push id32564
push uservalentin.gosu@gmail.com
push dateMon, 17 Oct 2016 13:19:46 +0000
reviewersjesup
bugs1307491
milestone52.0a1
Bug 1307491 - (Part 4) Remove support for per-app-offline in PeerConnection.js [nukeb2g] r=jesup MozReview-Commit-ID: LdLx3bMG9Tx
dom/media/PeerConnection.js
--- a/dom/media/PeerConnection.js
+++ b/dom/media/PeerConnection.js
@@ -185,29 +185,16 @@ GlobalPCList.prototype = {
     }
     else if (topic == "network:offline-status-changed") {
       if (data == "offline") {
         // this._list shold be empty here
         this._networkdown = true;
       } else if (data == "online") {
         this._networkdown = false;
       }
-    } else if (topic == "network:app-offline-status-changed") {
-      // App changed offline status. The subject contains the appId for which
-      // we need to check the status
-      let appId = subject.QueryInterface(Ci.nsIAppOfflineInfo).appId;
-      let ios = Cc['@mozilla.org/network/io-service;1'].getService(Ci.nsIIOService);
-      for (let winId in this._list) {
-        if (appId != this._list[winId]._appId) {
-          continue;
-        }
-        if (ios.isAppOffline(appId)) {
-          cleanupWinId(this._list, winId);
-        }
-      }
     } else if (topic == "gmp-plugin-crash") {
       if (subject instanceof Ci.nsIWritablePropertyBag2) {
         let pluginID = subject.getPropertyAsUint32("pluginID");
         let pluginName = subject.getPropertyAsAString("pluginName");
         let data = { pluginID, pluginName };
         this.handleGMPCrash(data);
       }
     } else if (topic == "PeerConnection:response:allow" ||
@@ -379,30 +366,20 @@ RTCPeerConnection.prototype = {
         rtcConfig.iceServers = [];
       }
     } else {
       // This gets executed in the typical case when iceServers
       // are passed in through the web page.
       this._mustValidateRTCConfiguration(rtcConfig,
         "RTCPeerConnection constructor passed invalid RTCConfiguration");
     }
-    // Save the appId
     var principal = Cu.getWebIDLCallerPrincipal();
-    this._appId = principal.appId;
     this._isChrome = Services.scriptSecurityManager.isSystemPrincipal(principal);
 
-    // Get the offline status for this appId
-    let appOffline = false;
-    if (this._appId != Ci.nsIScriptSecurityManager.NO_APP_ID &&
-        this._appId != Ci.nsIScriptSecurityManager.UNKNOWN_APP_ID) {
-      let ios = Cc['@mozilla.org/network/io-service;1'].getService(Ci.nsIIOService);
-      appOffline = ios.isAppOffline(this._appId);
-    }
-
-    if (_globalPCList._networkdown || appOffline) {
+    if (_globalPCList._networkdown) {
       throw new this._win.DOMException(
           "Can't create RTCPeerConnections when the network is down",
           "InvalidStateError");
     }
 
     this.makeGetterSetterEH("ontrack");
     this.makeLegacyGetterSetterEH("onaddstream", "Use peerConnection.ontrack instead.");
     this.makeLegacyGetterSetterEH("onaddtrack", "Use peerConnection.ontrack instead.");