Backed out changeset 50497f2cdd28 (bug 1291715)

This commit is contained in:
Sebastian Hengst 2016-10-05 17:03:02 +02:00
Родитель 8e6bfb5804
Коммит c40a5db6f5
2 изменённых файлов: 1 добавлений и 66 удалений

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

@ -26,7 +26,6 @@ const PC_STATIC_CONTRACT = "@mozilla.org/dom/peerconnectionstatic;1";
const PC_SENDER_CONTRACT = "@mozilla.org/dom/rtpsender;1";
const PC_RECEIVER_CONTRACT = "@mozilla.org/dom/rtpreceiver;1";
const PC_COREQUEST_CONTRACT = "@mozilla.org/dom/createofferrequest;1";
const PC_DTMF_SENDER_CONTRACT = "@mozilla.org/dom/rtcdtmfsender;1";
const PC_CID = Components.ID("{bdc2e533-b308-4708-ac8e-a8bfade6d851}");
const PC_OBS_CID = Components.ID("{d1748d4c-7f6a-4dc5-add6-d55b7678537e}");
@ -38,7 +37,6 @@ const PC_STATIC_CID = Components.ID("{0fb47c47-a205-4583-a9fc-cbadf8c95880}");
const PC_SENDER_CID = Components.ID("{4fff5d46-d827-4cd4-a970-8fd53977440e}");
const PC_RECEIVER_CID = Components.ID("{d974b814-8fde-411c-8c45-b86791b81030}");
const PC_COREQUEST_CID = Components.ID("{74b2122d-65a8-4824-aa9e-3d664cb75dc2}");
const PC_DTMF_SENDER_CID = Components.ID("{3610C242-654E-11E6-8EC0-6D1BE389A607}");
// Global list of PeerConnection objects, so they can be cleaned up when
// a page is torn down. (Maps inner window ID to an array of PC objects).
@ -1068,14 +1066,6 @@ RTCPeerConnection.prototype = {
}
},
_insertDTMF: function(sender, tones, duration, interToneGap) {
return this._impl.insertDTMF(sender.__DOM_IMPL__, tones, duration, interToneGap);
},
_getDTMFToneBuffer: function(sender) {
return this._impl.getDTMFToneBuffer(sender.__DOM_IMPL__);
},
_replaceTrack: function(sender, withTrack) {
// TODO: Do a (sender._stream.getTracks().indexOf(track) < 0) check
// on both track args someday.
@ -1570,11 +1560,7 @@ PeerConnectionObserver.prototype = {
{ channel: channel }));
},
onDTMFToneChange: function(trackId, tone) {
var pc = this._dompc;
var sender = pc._senders.find(sender => sender.track.id == trackId)
sender.dtmf.dispatchEvent(new pc._win.RTCDTMFToneChangeEvent("tonechange",
{ tone: tone }));
onDTMFToneChangeEvent: function(trackId, tone) {
}
};
@ -1598,58 +1584,10 @@ RTCPeerConnectionStatic.prototype = {
},
};
function RTCDTMFSender(sender) {
this._sender = sender;
this.duration = 100;
this.interToneGap = 70;
}
RTCDTMFSender.prototype = {
classDescription: "RTCDTMFSender",
classID: PC_DTMF_SENDER_CID,
contractID: PC_DTMF_SENDER_CONTRACT,
QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports]),
get toneBuffer() {
return this._sender._pc._getDTMFToneBuffer(this._sender);
},
get ontonechange() {
return this.__DOM_IMPL__.getEventHandler("ontonechange");
},
set ontonechange(handler) {
this.__DOM_IMPL__.setEventHandler("ontonechange", handler);
},
insertDTMF: function(tones, duration, interToneGap) {
this._sender._pc._checkClosed();
if (this._sender._pc._senders.indexOf(this._sender.__DOM_IMPL__) == -1) {
throw new this._sender._pc._win.DOMException("RTCRtpSender is stopped",
"InvalidStateError");
}
this.duration = Math.max(40, Math.min(duration, 6000));
if (interToneGap < 30) interToneGap = 30;
this.interToneGap = interToneGap;
tones = tones.toUpperCase();
if (tones.match(/[^0-9A-D#*,]/)) {
throw new this._sender._pc._win.DOMException("Invalid DTMF characters",
"InvalidCharacterError");
}
this._sender._pc._insertDTMF(this._sender, tones, duration, interToneGap);
},
};
function RTCRtpSender(pc, track, stream) {
this._pc = pc;
this.track = track;
this._stream = stream;
this.dtmf = pc._win.RTCDTMFSender._create(pc._win, new RTCDTMFSender(this));
}
RTCRtpSender.prototype = {
classDescription: "RTCRtpSender",
@ -1697,7 +1635,6 @@ CreateOfferRequest.prototype = {
this.NSGetFactory = XPCOMUtils.generateNSGetFactory(
[GlobalPCList,
RTCDTMFSender,
RTCIceCandidate,
RTCSessionDescription,
RTCPeerConnection,

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

@ -8,11 +8,9 @@ component {0fb47c47-a205-4583-a9fc-cbadf8c95880} PeerConnection.js
component {4fff5d46-d827-4cd4-a970-8fd53977440e} PeerConnection.js
component {d974b814-8fde-411c-8c45-b86791b81030} PeerConnection.js
component {74b2122d-65a8-4824-aa9e-3d664cb75dc2} PeerConnection.js
component {3610C242-654E-11E6-8EC0-6D1BE389A607} PeerConnection.js
contract @mozilla.org/dom/peerconnection;1 {bdc2e533-b308-4708-ac8e-a8bfade6d851}
contract @mozilla.org/dom/peerconnectionobserver;1 {d1748d4c-7f6a-4dc5-add6-d55b7678537e}
contract @mozilla.org/dom/rtcdtmfsender;1 {3610C242-654E-11E6-8EC0-6D1BE389A607}
contract @mozilla.org/dom/rtcicecandidate;1 {02b9970c-433d-4cc2-923d-f7028ac66073}
contract @mozilla.org/dom/rtcsessiondescription;1 {1775081b-b62d-4954-8ffe-a067bbf508a7}
contract @mozilla.org/dom/peerconnectionmanager;1 {7293e901-2be3-4c02-b4bd-cbef6fc24f78}