Bug 1307491 - (Part 4) Remove support for per-app-offline in PeerConnection.js [nukeb2g] r=jesup
MozReview-Commit-ID: LdLx3bMG9Tx
--- 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.");