Bug 1307491 - (Part 4) Remove support for per-app-offline in PeerConnection.js [nukeb2g] r=jesup

MozReview-Commit-ID: LdLx3bMG9Tx

--HG--
extra : rebase_source : a2d3d44970d17ef6f679adeed4f043c99b250744
This commit is contained in:
Valentin Gosu 2016-10-17 03:59:02 +02:00
Родитель 02543ae9c1
Коммит 8e9054d0b7
1 изменённых файлов: 1 добавлений и 24 удалений

Просмотреть файл

@ -190,19 +190,6 @@ GlobalPCList.prototype = {
} 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");
@ -384,20 +371,10 @@ RTCPeerConnection.prototype = {
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");