From de97297042f1ff11a0d0720ae47b2d8b0e5b6e5c Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Tue, 9 Sep 2014 10:52:23 -0400 Subject: [PATCH] Bug 1064088 - Deprecation warnings when required callbacks are missing. r=abr --- dom/media/PeerConnection.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dom/media/PeerConnection.js b/dom/media/PeerConnection.js index 82d21764285..0499c471165 100644 --- a/dom/media/PeerConnection.js +++ b/dom/media/PeerConnection.js @@ -637,6 +637,12 @@ RTCPeerConnection.prototype = { }, setLocalDescription: function(desc, onSuccess, onError) { + if (!onSuccess || !onError) { + this.logWarning( + "setLocalDescription called without success/failure callbacks. This is deprecated, and will be an error in the future.", + null, 0); + } + this._localType = desc.type; let type; @@ -668,6 +674,11 @@ RTCPeerConnection.prototype = { }, setRemoteDescription: function(desc, onSuccess, onError) { + if (!onSuccess || !onError) { + this.logWarning( + "setRemoteDescription called without success/failure callbacks. This is deprecated, and will be an error in the future.", + null, 0); + } this._remoteType = desc.type; let type; @@ -804,6 +815,11 @@ RTCPeerConnection.prototype = { }, addIceCandidate: function(cand, onSuccess, onError) { + if (!onSuccess || !onError) { + this.logWarning( + "addIceCandidate called without success/failure callbacks. This is deprecated, and will be an error in the future.", + null, 0); + } if (!cand.candidate && !cand.sdpMLineIndex) { throw new this._win.DOMError("", "Invalid candidate passed to addIceCandidate!");