Chromium Code Reviews| 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 216 void OnSuccess(std::unique_ptr<WebRTCCertificate> certificate) override { | 216 void OnSuccess(std::unique_ptr<WebRTCCertificate> certificate) override { |
| 217 resolver_->Resolve(new RTCCertificate(std::move(certificate))); | 217 resolver_->Resolve(new RTCCertificate(std::move(certificate))); |
| 218 } | 218 } |
| 219 | 219 |
| 220 void OnError() override { resolver_->Reject(); } | 220 void OnError() override { resolver_->Reject(); } |
| 221 | 221 |
| 222 Persistent<ScriptPromiseResolver> resolver_; | 222 Persistent<ScriptPromiseResolver> resolver_; |
| 223 }; | 223 }; |
| 224 | 224 |
| 225 WebRTCIceTransportPolicy IceTransportPolicyFromString(const String& policy) { | 225 WebRTCIceTransportPolicy IceTransportPolicyFromString(const String& policy) { |
| 226 if (policy == "none") | |
| 227 return WebRTCIceTransportPolicy::kNone; | |
| 228 if (policy == "relay") | 226 if (policy == "relay") |
| 229 return WebRTCIceTransportPolicy::kRelay; | 227 return WebRTCIceTransportPolicy::kRelay; |
| 230 DCHECK_EQ(policy, "all"); | 228 DCHECK_EQ(policy, "all"); |
| 231 return WebRTCIceTransportPolicy::kAll; | 229 return WebRTCIceTransportPolicy::kAll; |
| 232 } | 230 } |
| 233 | 231 |
| 234 WebRTCConfiguration ParseConfiguration(ExecutionContext* context, | 232 WebRTCConfiguration ParseConfiguration(ExecutionContext* context, |
| 235 const RTCConfiguration& configuration, | 233 const RTCConfiguration& configuration, |
| 236 ExceptionState& exception_state) { | 234 ExceptionState& exception_state) { |
| 237 DCHECK(context); | 235 DCHECK(context); |
| 238 | 236 |
| 239 WebRTCIceTransportPolicy ice_transport_policy = | 237 WebRTCIceTransportPolicy ice_transport_policy = |
| 240 WebRTCIceTransportPolicy::kAll; | 238 WebRTCIceTransportPolicy::kAll; |
| 241 if (configuration.hasIceTransportPolicy()) { | 239 if (configuration.hasIceTransportPolicy()) { |
| 242 UseCounter::Count(context, UseCounter::kRTCConfigurationIceTransportPolicy); | 240 UseCounter::Count(context, UseCounter::kRTCConfigurationIceTransportPolicy); |
| 243 ice_transport_policy = | 241 ice_transport_policy = |
| 244 IceTransportPolicyFromString(configuration.iceTransportPolicy()); | 242 IceTransportPolicyFromString(configuration.iceTransportPolicy()); |
| 245 if (ice_transport_policy == WebRTCIceTransportPolicy::kNone) { | |
| 246 UseCounter::Count(context, | |
| 247 UseCounter::kRTCConfigurationIceTransportPolicyNone); | |
| 248 } | |
| 249 } else if (configuration.hasIceTransports()) { | 243 } else if (configuration.hasIceTransports()) { |
| 250 UseCounter::Count(context, UseCounter::kRTCConfigurationIceTransports); | 244 UseCounter::Count(context, UseCounter::kRTCConfigurationIceTransports); |
| 251 ice_transport_policy = | 245 ice_transport_policy = |
| 252 IceTransportPolicyFromString(configuration.iceTransports()); | 246 IceTransportPolicyFromString(configuration.iceTransports()); |
| 253 if (ice_transport_policy == WebRTCIceTransportPolicy::kNone) | |
| 254 UseCounter::Count(context, | |
| 255 UseCounter::kRTCConfigurationIceTransportsNone); | |
|
foolip
2017/04/12 13:02:40
This should also be removed from UseCounter.h
hbos_chromium
2017/04/13 11:33:42
Done.
| |
| 256 } | 247 } |
| 257 | 248 |
| 258 WebRTCBundlePolicy bundle_policy = WebRTCBundlePolicy::kBalanced; | 249 WebRTCBundlePolicy bundle_policy = WebRTCBundlePolicy::kBalanced; |
| 259 String bundle_policy_string = configuration.bundlePolicy(); | 250 String bundle_policy_string = configuration.bundlePolicy(); |
| 260 if (bundle_policy_string == "max-compat") { | 251 if (bundle_policy_string == "max-compat") { |
| 261 bundle_policy = WebRTCBundlePolicy::kMaxCompat; | 252 bundle_policy = WebRTCBundlePolicy::kMaxCompat; |
| 262 } else if (bundle_policy_string == "max-bundle") { | 253 } else if (bundle_policy_string == "max-bundle") { |
| 263 bundle_policy = WebRTCBundlePolicy::kMaxBundle; | 254 bundle_policy = WebRTCBundlePolicy::kMaxBundle; |
| 264 } else { | 255 } else { |
| 265 DCHECK_EQ(bundle_policy_string, "balanced"); | 256 DCHECK_EQ(bundle_policy_string, "balanced"); |
| (...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1566 visitor->Trace(local_streams_); | 1557 visitor->Trace(local_streams_); |
| 1567 visitor->Trace(remote_streams_); | 1558 visitor->Trace(remote_streams_); |
| 1568 visitor->Trace(rtp_receivers_); | 1559 visitor->Trace(rtp_receivers_); |
| 1569 visitor->Trace(dispatch_scheduled_event_runner_); | 1560 visitor->Trace(dispatch_scheduled_event_runner_); |
| 1570 visitor->Trace(scheduled_events_); | 1561 visitor->Trace(scheduled_events_); |
| 1571 EventTargetWithInlineData::Trace(visitor); | 1562 EventTargetWithInlineData::Trace(visitor); |
| 1572 SuspendableObject::Trace(visitor); | 1563 SuspendableObject::Trace(visitor); |
| 1573 } | 1564 } |
| 1574 | 1565 |
| 1575 } // namespace blink | 1566 } // namespace blink |
| OLD | NEW |