Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(522)

Unified Diff: third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp

Issue 2451763002: Require username and credential for turn/turns (Closed)
Patch Set: restore non-throwing test Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/imported/wpt/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
index 0e627f0d90ee1c221789aed757dc78dab2b732ab..79f35a22693a050135726de006be5a2fbaca6f97 100644
--- a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
+++ b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
@@ -319,6 +319,13 @@ WebRTCConfiguration parseConfiguration(ExecutionContext* context,
"'stun', 'turn' or 'turns'.");
return WebRTCConfiguration();
}
+ if ((url.protocolIs("turn") || url.protocolIs("turns")) &&
+ (username.isNull() || credential.isNull())) {
+ exceptionState.throwDOMException(InvalidAccessError,
+ "Both username and credential are "
+ "required when the URL scheme is "
+ "\"turn\" or \"turns\".");
+ }
iceServers.append(WebRTCIceServer{url, username, credential});
}
}
« no previous file with comments | « third_party/WebKit/LayoutTests/imported/wpt/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698