Bug 1247619 - add console warning about OAuth for STUN not yet supported. r=jesup,smaug
authorJan-Ivar Bruaroey <jib@mozilla.com>
Thu, 25 Feb 2016 00:24:16 -0500
changeset 321952 e3235792878fe0f7b434882f8569be7532c88ab1
parent 321951 636081f1b33208ad8f8fa1a537db90911f1873e7
child 321953 a6895a0070b11da334a0098f641a3a2a8eb18b6b
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup, smaug
bugs1247619
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1247619 - add console warning about OAuth for STUN not yet supported. r=jesup,smaug MozReview-Commit-ID: L0nViIWiIDn
dom/media/PeerConnection.js
dom/webidl/RTCConfiguration.webidl
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
--- a/dom/media/PeerConnection.js
+++ b/dom/media/PeerConnection.js
@@ -581,16 +581,23 @@ RTCPeerConnection.prototype = {
           if (!server.username) {
             throw new this._win.DOMException(msg + " - missing username: " + urlStr,
                                              "InvalidAccessError");
           }
           if (!server.credential) {
             throw new this._win.DOMException(msg + " - missing credential: " + urlStr,
                                              "InvalidAccessError");
           }
+          if (server.credentialType != "password") {
+            this.logWarning("RTCConfiguration TURN credentialType \""+
+                            server.credentialType +
+                            "\" is not yet implemented. Treating as password."+
+                            " https://bugzil.la/1247616",
+                            null, 0);
+          }
         }
         else if (!(url.scheme in { stun:1, stuns:1 })) {
           throw new this._win.DOMException(msg + " - improper scheme: " + url.scheme,
                                            "SyntaxError");
         }
         if (url.scheme in { stuns:1, turns:1 }) {
           this.logWarning(url.scheme.toUpperCase() + " is not yet supported.", null, 0);
         }
--- a/dom/webidl/RTCConfiguration.webidl
+++ b/dom/webidl/RTCConfiguration.webidl
@@ -2,21 +2,27 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  * The origin of this IDL file is
  * http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCConfiguration
  */
 
+enum RTCIceCredentialType {
+    "password",
+    "token"
+};
+
 dictionary RTCIceServer {
     (DOMString or sequence<DOMString>) urls;
     DOMString  url; //deprecated
-    DOMString? credential = null;
-    DOMString? username = null;
+    DOMString username;
+    DOMString credential;
+    RTCIceCredentialType credentialType = "password";
 };
 
 enum RTCIceTransportPolicy {
     "none",
     "relay",
     "all"
 };
 
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -658,18 +658,18 @@ PeerConnectionConfiguration::AddIceServe
       if (hostPos > 1)  /* The username was removed */
         return NS_ERROR_FAILURE;
       path.Mid(host, hostPos, hostLen);
     }
     if (port == -1)
       port = (isStuns || isTurns)? 5349 : 3478;
 
     if (isTurn || isTurns) {
-      NS_ConvertUTF16toUTF8 credential(aServer.mCredential);
-      NS_ConvertUTF16toUTF8 username(aServer.mUsername);
+      NS_ConvertUTF16toUTF8 credential(aServer.mCredential.Value());
+      NS_ConvertUTF16toUTF8 username(aServer.mUsername.Value());
 
       if (!addTurnServer(host.get(), port,
                          username.get(),
                          credential.get(),
                          (transport.IsEmpty() ?
                           kNrIceTransportUdp : transport.get()))) {
         return NS_ERROR_FAILURE;
       }