| 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 2f22f6861e5a0988b7a0e4f103b23206f012ed2d..936d5f06d89efc12d6c8e6bb1946ca5d4a0bf2ae 100644
|
| --- a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
|
| +++ b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
|
| @@ -218,6 +218,15 @@ class WebRTCCertificateObserver : public WebRTCCertificateCallback {
|
| Persistent<ScriptPromiseResolver> m_resolver;
|
| };
|
|
|
| +WebRTCIceTransportPolicy iceTransportPolicyFromString(const String& policy) {
|
| + if (policy == "none")
|
| + return WebRTCIceTransportPolicy::kNone;
|
| + if (policy == "relay")
|
| + return WebRTCIceTransportPolicy::kRelay;
|
| + DCHECK_EQ(policy, "all");
|
| + return WebRTCIceTransportPolicy::kAll;
|
| +}
|
| +
|
| WebRTCConfiguration parseConfiguration(ExecutionContext* context,
|
| const RTCConfiguration& configuration,
|
| ExceptionState& exceptionState,
|
| @@ -225,15 +234,21 @@ WebRTCConfiguration parseConfiguration(ExecutionContext* context,
|
| DCHECK(context);
|
| DCHECK(selectedRtcpMuxPolicy);
|
|
|
| - WebRTCIceTransports iceTransports = WebRTCIceTransports::kAll;
|
| - String iceTransportsString = configuration.iceTransports();
|
| - if (iceTransportsString == "none") {
|
| - UseCounter::count(context, UseCounter::RTCConfigurationIceTransportsNone);
|
| - iceTransports = WebRTCIceTransports::kNone;
|
| - } else if (iceTransportsString == "relay") {
|
| - iceTransports = WebRTCIceTransports::kRelay;
|
| - } else {
|
| - DCHECK_EQ(iceTransportsString, "all");
|
| + WebRTCIceTransportPolicy iceTransportPolicy = WebRTCIceTransportPolicy::kAll;
|
| + if (configuration.hasIceTransportPolicy()) {
|
| + UseCounter::count(context, UseCounter::RTCConfigurationIceTransportPolicy);
|
| + iceTransportPolicy =
|
| + iceTransportPolicyFromString(configuration.iceTransportPolicy());
|
| + if (iceTransportPolicy == WebRTCIceTransportPolicy::kNone) {
|
| + UseCounter::count(context,
|
| + UseCounter::RTCConfigurationIceTransportPolicyNone);
|
| + }
|
| + } else if (configuration.hasIceTransports()) {
|
| + UseCounter::count(context, UseCounter::RTCConfigurationIceTransports);
|
| + iceTransportPolicy =
|
| + iceTransportPolicyFromString(configuration.iceTransports());
|
| + if (iceTransportPolicy == WebRTCIceTransportPolicy::kNone)
|
| + UseCounter::count(context, UseCounter::RTCConfigurationIceTransportsNone);
|
| }
|
|
|
| WebRTCBundlePolicy bundlePolicy = WebRTCBundlePolicy::kBalanced;
|
| @@ -261,7 +276,7 @@ WebRTCConfiguration parseConfiguration(ExecutionContext* context,
|
| }
|
|
|
| WebRTCConfiguration webConfiguration;
|
| - webConfiguration.iceTransports = iceTransports;
|
| + webConfiguration.iceTransportPolicy = iceTransportPolicy;
|
| webConfiguration.bundlePolicy = bundlePolicy;
|
| webConfiguration.rtcpMuxPolicy = rtcpMuxPolicy;
|
|
|
|
|