OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
218 Persistent<ScriptPromiseResolver> m_resolver; | 218 Persistent<ScriptPromiseResolver> m_resolver; |
219 }; | 219 }; |
220 | 220 |
221 WebRTCConfiguration parseConfiguration(ExecutionContext* context, | 221 WebRTCConfiguration parseConfiguration(ExecutionContext* context, |
222 const RTCConfiguration& configuration, | 222 const RTCConfiguration& configuration, |
223 ExceptionState& exceptionState, | 223 ExceptionState& exceptionState, |
224 RtcpMuxPolicy* selectedRtcpMuxPolicy) { | 224 RtcpMuxPolicy* selectedRtcpMuxPolicy) { |
225 DCHECK(context); | 225 DCHECK(context); |
226 DCHECK(selectedRtcpMuxPolicy); | 226 DCHECK(selectedRtcpMuxPolicy); |
227 | 227 |
228 WebRTCIceTransports iceTransports = WebRTCIceTransports::kAll; | 228 WebRTCIceTransportPolicy iceTransportPolicy = WebRTCIceTransportPolicy::kAll; |
229 String iceTransportsString = configuration.iceTransports(); | 229 if (configuration.hasIceTransportPolicy()) { |
230 if (iceTransportsString == "none") { | 230 UseCounter::count(context, UseCounter::RTCConfigurationIceTransportPolicy); |
231 UseCounter::count(context, UseCounter::RTCConfigurationIceTransportsNone); | 231 String iceTransportPolicyString = configuration.iceTransportPolicy(); |
232 iceTransports = WebRTCIceTransports::kNone; | 232 if (iceTransportPolicyString == "none") { |
233 } else if (iceTransportsString == "relay") { | 233 UseCounter::count(context, |
234 iceTransports = WebRTCIceTransports::kRelay; | 234 UseCounter::RTCConfigurationIceTransportPolicyNone); |
235 } else { | 235 iceTransportPolicy = WebRTCIceTransportPolicy::kNone; |
236 DCHECK_EQ(iceTransportsString, "all"); | 236 } else if (iceTransportPolicyString == "relay") { |
237 iceTransportPolicy = WebRTCIceTransportPolicy::kRelay; | |
238 } else { | |
239 DCHECK_EQ(iceTransportPolicyString, "all"); | |
240 } | |
241 } else if (configuration.hasIceTransports()) { | |
242 UseCounter::count(context, UseCounter::RTCConfigurationIceTransports); | |
243 String iceTransportsString = configuration.iceTransports(); | |
244 if (iceTransportsString == "none") { | |
hta - Chromium
2016/10/25 13:37:41
Can you do these 2 translations of icetransportPol
foolip
2016/10/25 15:43:04
Done.
| |
245 UseCounter::count(context, UseCounter::RTCConfigurationIceTransportsNone); | |
246 iceTransportPolicy = WebRTCIceTransportPolicy::kNone; | |
247 } else if (iceTransportsString == "relay") { | |
248 iceTransportPolicy = WebRTCIceTransportPolicy::kRelay; | |
249 } else { | |
250 DCHECK_EQ(iceTransportsString, "all"); | |
251 } | |
237 } | 252 } |
238 | 253 |
239 WebRTCBundlePolicy bundlePolicy = WebRTCBundlePolicy::kBalanced; | 254 WebRTCBundlePolicy bundlePolicy = WebRTCBundlePolicy::kBalanced; |
240 String bundlePolicyString = configuration.bundlePolicy(); | 255 String bundlePolicyString = configuration.bundlePolicy(); |
241 if (bundlePolicyString == "max-compat") { | 256 if (bundlePolicyString == "max-compat") { |
242 bundlePolicy = WebRTCBundlePolicy::kMaxCompat; | 257 bundlePolicy = WebRTCBundlePolicy::kMaxCompat; |
243 } else if (bundlePolicyString == "max-bundle") { | 258 } else if (bundlePolicyString == "max-bundle") { |
244 bundlePolicy = WebRTCBundlePolicy::kMaxBundle; | 259 bundlePolicy = WebRTCBundlePolicy::kMaxBundle; |
245 } else { | 260 } else { |
246 DCHECK_EQ(bundlePolicyString, "balanced"); | 261 DCHECK_EQ(bundlePolicyString, "balanced"); |
247 } | 262 } |
248 | 263 |
249 // For the histogram value of "WebRTC.PeerConnection.SelectedRtcpMuxPolicy". | 264 // For the histogram value of "WebRTC.PeerConnection.SelectedRtcpMuxPolicy". |
250 *selectedRtcpMuxPolicy = RtcpMuxPolicyDefault; | 265 *selectedRtcpMuxPolicy = RtcpMuxPolicyDefault; |
251 WebRTCRtcpMuxPolicy rtcpMuxPolicy = WebRTCRtcpMuxPolicy::kNegotiate; | 266 WebRTCRtcpMuxPolicy rtcpMuxPolicy = WebRTCRtcpMuxPolicy::kNegotiate; |
252 if (configuration.hasRtcpMuxPolicy()) { | 267 if (configuration.hasRtcpMuxPolicy()) { |
253 String rtcpMuxPolicyString = configuration.rtcpMuxPolicy(); | 268 String rtcpMuxPolicyString = configuration.rtcpMuxPolicy(); |
254 if (rtcpMuxPolicyString == "require") { | 269 if (rtcpMuxPolicyString == "require") { |
255 *selectedRtcpMuxPolicy = RtcpMuxPolicyRequire; | 270 *selectedRtcpMuxPolicy = RtcpMuxPolicyRequire; |
256 rtcpMuxPolicy = WebRTCRtcpMuxPolicy::kRequire; | 271 rtcpMuxPolicy = WebRTCRtcpMuxPolicy::kRequire; |
257 } else { | 272 } else { |
258 DCHECK_EQ(rtcpMuxPolicyString, "negotiate"); | 273 DCHECK_EQ(rtcpMuxPolicyString, "negotiate"); |
259 *selectedRtcpMuxPolicy = RtcpMuxPolicyNegotiate; | 274 *selectedRtcpMuxPolicy = RtcpMuxPolicyNegotiate; |
260 } | 275 } |
261 } | 276 } |
262 | 277 |
263 WebRTCConfiguration webConfiguration; | 278 WebRTCConfiguration webConfiguration; |
264 webConfiguration.iceTransports = iceTransports; | 279 webConfiguration.iceTransportPolicy = iceTransportPolicy; |
265 webConfiguration.bundlePolicy = bundlePolicy; | 280 webConfiguration.bundlePolicy = bundlePolicy; |
266 webConfiguration.rtcpMuxPolicy = rtcpMuxPolicy; | 281 webConfiguration.rtcpMuxPolicy = rtcpMuxPolicy; |
267 | 282 |
268 if (configuration.hasIceServers()) { | 283 if (configuration.hasIceServers()) { |
269 Vector<WebRTCIceServer> iceServers; | 284 Vector<WebRTCIceServer> iceServers; |
270 for (const RTCIceServer& iceServer : configuration.iceServers()) { | 285 for (const RTCIceServer& iceServer : configuration.iceServers()) { |
271 Vector<String> urlStrings; | 286 Vector<String> urlStrings; |
272 if (iceServer.hasURLs()) { | 287 if (iceServer.hasURLs()) { |
273 UseCounter::count(context, UseCounter::RTCIceServerURLs); | 288 UseCounter::count(context, UseCounter::RTCIceServerURLs); |
274 const StringOrStringSequence& urls = iceServer.urls(); | 289 const StringOrStringSequence& urls = iceServer.urls(); |
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1452 DEFINE_TRACE(RTCPeerConnection) { | 1467 DEFINE_TRACE(RTCPeerConnection) { |
1453 visitor->trace(m_localStreams); | 1468 visitor->trace(m_localStreams); |
1454 visitor->trace(m_remoteStreams); | 1469 visitor->trace(m_remoteStreams); |
1455 visitor->trace(m_dispatchScheduledEventRunner); | 1470 visitor->trace(m_dispatchScheduledEventRunner); |
1456 visitor->trace(m_scheduledEvents); | 1471 visitor->trace(m_scheduledEvents); |
1457 EventTargetWithInlineData::trace(visitor); | 1472 EventTargetWithInlineData::trace(visitor); |
1458 ActiveDOMObject::trace(visitor); | 1473 ActiveDOMObject::trace(visitor); |
1459 } | 1474 } |
1460 | 1475 |
1461 } // namespace blink | 1476 } // namespace blink |
OLD | NEW |