| 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 12 matching lines...) Expand all Loading... |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "modules/peerconnection/RTCPeerConnection.h" | 31 #include "modules/peerconnection/RTCPeerConnection.h" |
| 32 | 32 |
| 33 #include "bindings/core/v8/ArrayValue.h" | |
| 34 #include "bindings/core/v8/ExceptionMessages.h" | 33 #include "bindings/core/v8/ExceptionMessages.h" |
| 35 #include "bindings/core/v8/ExceptionState.h" | 34 #include "bindings/core/v8/ExceptionState.h" |
| 36 #include "bindings/core/v8/Microtask.h" | 35 #include "bindings/core/v8/Microtask.h" |
| 37 #include "bindings/core/v8/Nullable.h" | 36 #include "bindings/core/v8/Nullable.h" |
| 38 #include "bindings/core/v8/ScriptPromiseResolver.h" | 37 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 39 #include "bindings/core/v8/ScriptState.h" | 38 #include "bindings/core/v8/ScriptState.h" |
| 40 #include "bindings/core/v8/ScriptValue.h" | 39 #include "bindings/core/v8/ScriptValue.h" |
| 41 #include "bindings/core/v8/V8ThrowException.h" | 40 #include "bindings/core/v8/V8ThrowException.h" |
| 42 #include "bindings/modules/v8/RTCIceCandidateInitOrRTCIceCandidate.h" | 41 #include "bindings/modules/v8/RTCIceCandidateInitOrRTCIceCandidate.h" |
| 43 #include "bindings/modules/v8/V8MediaStreamTrack.h" | 42 #include "bindings/modules/v8/V8MediaStreamTrack.h" |
| 44 #include "bindings/modules/v8/V8RTCCertificate.h" | 43 #include "bindings/modules/v8/V8RTCCertificate.h" |
| 45 #include "core/dom/DOMException.h" | 44 #include "core/dom/DOMException.h" |
| 46 #include "core/dom/DOMTimeStamp.h" | 45 #include "core/dom/DOMTimeStamp.h" |
| 47 #include "core/dom/Document.h" | 46 #include "core/dom/Document.h" |
| 48 #include "core/dom/ExceptionCode.h" | 47 #include "core/dom/ExceptionCode.h" |
| 49 #include "core/dom/ExecutionContext.h" | 48 #include "core/dom/ExecutionContext.h" |
| 50 #include "core/frame/HostsUsingFeatures.h" | 49 #include "core/frame/HostsUsingFeatures.h" |
| 51 #include "core/frame/LocalFrame.h" | 50 #include "core/frame/LocalFrame.h" |
| 52 #include "core/frame/UseCounter.h" | 51 #include "core/frame/UseCounter.h" |
| 53 #include "core/html/VoidCallback.h" | 52 #include "core/html/VoidCallback.h" |
| 54 #include "core/loader/FrameLoader.h" | 53 #include "core/loader/FrameLoader.h" |
| 55 #include "core/loader/FrameLoaderClient.h" | 54 #include "core/loader/FrameLoaderClient.h" |
| 56 #include "modules/crypto/CryptoResultImpl.h" | 55 #include "modules/crypto/CryptoResultImpl.h" |
| 57 #include "modules/mediastream/MediaConstraintsImpl.h" | 56 #include "modules/mediastream/MediaConstraintsImpl.h" |
| 58 #include "modules/mediastream/MediaStreamEvent.h" | 57 #include "modules/mediastream/MediaStreamEvent.h" |
| 59 #include "modules/peerconnection/RTCAnswerOptions.h" | 58 #include "modules/peerconnection/RTCAnswerOptions.h" |
| 59 #include "modules/peerconnection/RTCConfiguration.h" |
| 60 #include "modules/peerconnection/RTCDTMFSender.h" | 60 #include "modules/peerconnection/RTCDTMFSender.h" |
| 61 #include "modules/peerconnection/RTCDataChannel.h" | 61 #include "modules/peerconnection/RTCDataChannel.h" |
| 62 #include "modules/peerconnection/RTCDataChannelEvent.h" | 62 #include "modules/peerconnection/RTCDataChannelEvent.h" |
| 63 #include "modules/peerconnection/RTCIceCandidateEvent.h" | 63 #include "modules/peerconnection/RTCIceCandidateEvent.h" |
| 64 #include "modules/peerconnection/RTCIceServer.h" |
| 64 #include "modules/peerconnection/RTCOfferOptions.h" | 65 #include "modules/peerconnection/RTCOfferOptions.h" |
| 65 #include "modules/peerconnection/RTCPeerConnectionErrorCallback.h" | 66 #include "modules/peerconnection/RTCPeerConnectionErrorCallback.h" |
| 66 #include "modules/peerconnection/RTCSessionDescription.h" | 67 #include "modules/peerconnection/RTCSessionDescription.h" |
| 67 #include "modules/peerconnection/RTCSessionDescriptionCallback.h" | 68 #include "modules/peerconnection/RTCSessionDescriptionCallback.h" |
| 68 #include "modules/peerconnection/RTCSessionDescriptionInit.h" | 69 #include "modules/peerconnection/RTCSessionDescriptionInit.h" |
| 69 #include "modules/peerconnection/RTCSessionDescriptionRequestImpl.h" | 70 #include "modules/peerconnection/RTCSessionDescriptionRequestImpl.h" |
| 70 #include "modules/peerconnection/RTCSessionDescriptionRequestPromiseImpl.h" | 71 #include "modules/peerconnection/RTCSessionDescriptionRequestPromiseImpl.h" |
| 71 #include "modules/peerconnection/RTCStatsCallback.h" | 72 #include "modules/peerconnection/RTCStatsCallback.h" |
| 72 #include "modules/peerconnection/RTCStatsReport.h" | 73 #include "modules/peerconnection/RTCStatsReport.h" |
| 73 #include "modules/peerconnection/RTCStatsRequestImpl.h" | 74 #include "modules/peerconnection/RTCStatsRequestImpl.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 211 |
| 211 void onSuccess(std::unique_ptr<WebRTCCertificate> certificate) override { | 212 void onSuccess(std::unique_ptr<WebRTCCertificate> certificate) override { |
| 212 m_resolver->resolve(new RTCCertificate(std::move(certificate))); | 213 m_resolver->resolve(new RTCCertificate(std::move(certificate))); |
| 213 } | 214 } |
| 214 | 215 |
| 215 void onError() override { m_resolver->reject(); } | 216 void onError() override { m_resolver->reject(); } |
| 216 | 217 |
| 217 Persistent<ScriptPromiseResolver> m_resolver; | 218 Persistent<ScriptPromiseResolver> m_resolver; |
| 218 }; | 219 }; |
| 219 | 220 |
| 220 WebRTCConfiguration parseConfiguration(const Dictionary& configuration, | 221 WebRTCConfiguration parseConfiguration(ExecutionContext* context, |
| 222 const RTCConfiguration& configuration, |
| 221 ExceptionState& exceptionState, | 223 ExceptionState& exceptionState, |
| 222 RtcpMuxPolicy* selectedRtcpMuxPolicy) { | 224 RtcpMuxPolicy* selectedRtcpMuxPolicy) { |
| 223 WebRTCConfiguration rtcConfiguration; | 225 DCHECK(context); |
| 224 if (configuration.isUndefinedOrNull()) | 226 DCHECK(selectedRtcpMuxPolicy); |
| 225 return WebRTCConfiguration(); | |
| 226 | 227 |
| 227 WebRTCIceTransports iceTransports = WebRTCIceTransports::kAll; | 228 WebRTCIceTransports iceTransports = WebRTCIceTransports::kAll; |
| 228 String iceTransportsString; | 229 String iceTransportsString = configuration.iceTransports(); |
| 229 if (DictionaryHelper::get(configuration, "iceTransports", | 230 if (iceTransportsString == "none") { |
| 230 iceTransportsString)) { | 231 UseCounter::count(context, UseCounter::RTCConfigurationIceTransportsNone); |
| 231 if (iceTransportsString == "none") { | 232 iceTransports = WebRTCIceTransports::kNone; |
| 232 iceTransports = WebRTCIceTransports::kNone; | 233 } else if (iceTransportsString == "relay") { |
| 233 } else if (iceTransportsString == "relay") { | 234 iceTransports = WebRTCIceTransports::kRelay; |
| 234 iceTransports = WebRTCIceTransports::kRelay; | 235 } else { |
| 235 } else if (iceTransportsString != "all") { | 236 DCHECK_EQ(iceTransportsString, "all"); |
| 236 exceptionState.throwTypeError("Malformed RTCIceTransports"); | |
| 237 return WebRTCConfiguration(); | |
| 238 } | |
| 239 } | |
| 240 | |
| 241 ArrayValue iceServers; | |
| 242 bool ok = DictionaryHelper::get(configuration, "iceServers", iceServers); | |
| 243 if (!ok || iceServers.isUndefinedOrNull()) { | |
| 244 exceptionState.throwTypeError("Malformed RTCConfiguration"); | |
| 245 return WebRTCConfiguration(); | |
| 246 } | |
| 247 | |
| 248 size_t numberOfServers; | |
| 249 ok = iceServers.length(numberOfServers); | |
| 250 if (!ok) { | |
| 251 exceptionState.throwTypeError("Malformed RTCConfiguration"); | |
| 252 return WebRTCConfiguration(); | |
| 253 } | 237 } |
| 254 | 238 |
| 255 WebRTCBundlePolicy bundlePolicy = WebRTCBundlePolicy::kBalanced; | 239 WebRTCBundlePolicy bundlePolicy = WebRTCBundlePolicy::kBalanced; |
| 256 String bundlePolicyString; | 240 String bundlePolicyString = configuration.bundlePolicy(); |
| 257 if (DictionaryHelper::get(configuration, "bundlePolicy", | 241 if (bundlePolicyString == "max-compat") { |
| 258 bundlePolicyString)) { | 242 bundlePolicy = WebRTCBundlePolicy::kMaxCompat; |
| 259 if (bundlePolicyString == "max-compat") { | 243 } else if (bundlePolicyString == "max-bundle") { |
| 260 bundlePolicy = WebRTCBundlePolicy::kMaxCompat; | 244 bundlePolicy = WebRTCBundlePolicy::kMaxBundle; |
| 261 } else if (bundlePolicyString == "max-bundle") { | 245 } else { |
| 262 bundlePolicy = WebRTCBundlePolicy::kMaxBundle; | 246 DCHECK_EQ(bundlePolicyString, "balanced"); |
| 263 } else if (bundlePolicyString != "balanced") { | |
| 264 exceptionState.throwTypeError("Malformed RTCBundlePolicy"); | |
| 265 return WebRTCConfiguration(); | |
| 266 } | |
| 267 } | 247 } |
| 268 | 248 |
| 269 // For the histogram value of "WebRTC.PeerConnection.SelectedRtcpMuxPolicy". | 249 // For the histogram value of "WebRTC.PeerConnection.SelectedRtcpMuxPolicy". |
| 270 *selectedRtcpMuxPolicy = RtcpMuxPolicyDefault; | 250 *selectedRtcpMuxPolicy = RtcpMuxPolicyDefault; |
| 271 WebRTCRtcpMuxPolicy rtcpMuxPolicy = WebRTCRtcpMuxPolicy::kNegotiate; | 251 WebRTCRtcpMuxPolicy rtcpMuxPolicy = WebRTCRtcpMuxPolicy::kNegotiate; |
| 272 String rtcpMuxPolicyString; | 252 if (configuration.hasRtcpMuxPolicy()) { |
| 273 if (DictionaryHelper::get(configuration, "rtcpMuxPolicy", | 253 String rtcpMuxPolicyString = configuration.rtcpMuxPolicy(); |
| 274 rtcpMuxPolicyString)) { | |
| 275 if (rtcpMuxPolicyString == "require") { | 254 if (rtcpMuxPolicyString == "require") { |
| 276 *selectedRtcpMuxPolicy = RtcpMuxPolicyRequire; | 255 *selectedRtcpMuxPolicy = RtcpMuxPolicyRequire; |
| 277 rtcpMuxPolicy = WebRTCRtcpMuxPolicy::kRequire; | 256 rtcpMuxPolicy = WebRTCRtcpMuxPolicy::kRequire; |
| 278 } else if (rtcpMuxPolicyString == "negotiate") { | 257 } else { |
| 258 DCHECK_EQ(rtcpMuxPolicyString, "negotiate"); |
| 279 *selectedRtcpMuxPolicy = RtcpMuxPolicyNegotiate; | 259 *selectedRtcpMuxPolicy = RtcpMuxPolicyNegotiate; |
| 280 rtcpMuxPolicy = WebRTCRtcpMuxPolicy::kNegotiate; | |
| 281 } else { | |
| 282 exceptionState.throwTypeError("Malformed RTCRtcpMuxPolicy"); | |
| 283 return WebRTCConfiguration(); | |
| 284 } | 260 } |
| 285 } | 261 } |
| 286 | 262 |
| 287 rtcConfiguration.iceTransports = iceTransports; | 263 WebRTCConfiguration webConfiguration; |
| 288 rtcConfiguration.bundlePolicy = bundlePolicy; | 264 webConfiguration.iceTransports = iceTransports; |
| 289 rtcConfiguration.rtcpMuxPolicy = rtcpMuxPolicy; | 265 webConfiguration.bundlePolicy = bundlePolicy; |
| 266 webConfiguration.rtcpMuxPolicy = rtcpMuxPolicy; |
| 290 | 267 |
| 291 for (size_t i = 0; i < numberOfServers; ++i) { | 268 if (configuration.hasIceServers()) { |
| 292 Dictionary iceServer; | 269 Vector<WebRTCIceServer> iceServers; |
| 293 ok = iceServers.get(i, iceServer); | 270 for (const RTCIceServer& iceServer : configuration.iceServers()) { |
| 294 if (!ok) { | 271 Vector<String> urlStrings; |
| 295 exceptionState.throwTypeError("Malformed RTCIceServer"); | 272 if (iceServer.hasURLs()) { |
| 296 return WebRTCConfiguration(); | 273 UseCounter::count(context, UseCounter::RTCIceServerURLs); |
| 297 } | 274 const StringOrStringSequence& urls = iceServer.urls(); |
| 298 | 275 if (urls.isString()) { |
| 299 Vector<String> names; | 276 urlStrings.append(urls.getAsString()); |
| 300 iceServer.getPropertyNames(names); | |
| 301 | |
| 302 Vector<String> urlStrings; | |
| 303 if (names.contains("urls")) { | |
| 304 if (!DictionaryHelper::get(iceServer, "urls", urlStrings) || | |
| 305 !urlStrings.size()) { | |
| 306 String urlString; | |
| 307 if (DictionaryHelper::get(iceServer, "urls", urlString)) { | |
| 308 urlStrings.append(urlString); | |
| 309 } else { | 277 } else { |
| 310 exceptionState.throwTypeError("Malformed RTCIceServer"); | 278 DCHECK(urls.isStringSequence()); |
| 311 return WebRTCConfiguration(); | 279 urlStrings = urls.getAsStringSequence(); |
| 312 } | 280 } |
| 313 } | 281 } else if (iceServer.hasURL()) { |
| 314 } else if (names.contains("url")) { | 282 UseCounter::count(context, UseCounter::RTCIceServerURL); |
| 315 String urlString; | 283 urlStrings.append(iceServer.url()); |
| 316 if (DictionaryHelper::get(iceServer, "url", urlString)) { | |
| 317 urlStrings.append(urlString); | |
| 318 } else { | 284 } else { |
| 319 exceptionState.throwTypeError("Malformed RTCIceServer"); | 285 exceptionState.throwTypeError("Malformed RTCIceServer"); |
| 320 return WebRTCConfiguration(); | 286 return WebRTCConfiguration(); |
| 321 } | 287 } |
| 322 } else { | 288 |
| 323 exceptionState.throwTypeError("Malformed RTCIceServer"); | 289 String username = iceServer.username(); |
| 324 return WebRTCConfiguration(); | 290 String credential = iceServer.credential(); |
| 291 |
| 292 for (const String& urlString : urlStrings) { |
| 293 KURL url(KURL(), urlString); |
| 294 if (!url.isValid() || |
| 295 !(url.protocolIs("turn") || url.protocolIs("turns") || |
| 296 url.protocolIs("stun"))) { |
| 297 exceptionState.throwTypeError("Malformed URL"); |
| 298 return WebRTCConfiguration(); |
| 299 } |
| 300 iceServers.append(WebRTCIceServer{url, username, credential}); |
| 301 } |
| 325 } | 302 } |
| 326 | 303 webConfiguration.iceServers = iceServers; |
| 327 String username, credential; | |
| 328 DictionaryHelper::get(iceServer, "username", username); | |
| 329 DictionaryHelper::get(iceServer, "credential", credential); | |
| 330 | |
| 331 Vector<WebRTCIceServer> iceServers; | |
| 332 for (Vector<String>::iterator iter = urlStrings.begin(); | |
| 333 iter != urlStrings.end(); ++iter) { | |
| 334 KURL url(KURL(), *iter); | |
| 335 if (!url.isValid() || | |
| 336 !(url.protocolIs("turn") || url.protocolIs("turns") || | |
| 337 url.protocolIs("stun"))) { | |
| 338 exceptionState.throwTypeError("Malformed URL"); | |
| 339 return WebRTCConfiguration(); | |
| 340 } | |
| 341 iceServers.append(WebRTCIceServer{url, username, credential}); | |
| 342 } | |
| 343 rtcConfiguration.iceServers = iceServers; | |
| 344 } | 304 } |
| 345 | 305 |
| 346 ArrayValue certificates; | 306 if (configuration.hasCertificates()) { |
| 347 if (DictionaryHelper::get(configuration, "certificates", certificates) && | 307 const HeapVector<Member<RTCCertificate>>& certificates = |
| 348 !certificates.isUndefinedOrNull()) { | 308 configuration.certificates(); |
| 349 size_t numberOfCertificates; | |
| 350 certificates.length(numberOfCertificates); | |
| 351 WebVector<std::unique_ptr<WebRTCCertificate>> certificatesCopy( | 309 WebVector<std::unique_ptr<WebRTCCertificate>> certificatesCopy( |
| 352 numberOfCertificates); | 310 certificates.size()); |
| 353 for (size_t i = 0; i < numberOfCertificates; ++i) { | 311 for (size_t i = 0; i < certificates.size(); ++i) { |
| 354 RTCCertificate* certificate = nullptr; | 312 certificatesCopy[i] = certificates[i]->certificateShallowCopy(); |
| 313 } |
| 314 webConfiguration.certificates = std::move(certificatesCopy); |
| 315 } |
| 355 | 316 |
| 356 Dictionary dictCert; | 317 return webConfiguration; |
| 357 certificates.get(i, dictCert); | |
| 358 v8::Local<v8::Value> valCert = dictCert.v8Value(); | |
| 359 if (!valCert.IsEmpty()) { | |
| 360 certificate = V8RTCCertificate::toImplWithTypeCheck( | |
| 361 configuration.isolate(), valCert); | |
| 362 } | |
| 363 if (!certificate) { | |
| 364 exceptionState.throwTypeError("Malformed sequence<RTCCertificate>"); | |
| 365 return WebRTCConfiguration(); | |
| 366 } | |
| 367 | |
| 368 certificatesCopy[i] = certificate->certificateShallowCopy(); | |
| 369 } | |
| 370 rtcConfiguration.certificates = std::move(certificatesCopy); | |
| 371 } | |
| 372 return rtcConfiguration; | |
| 373 } | 318 } |
| 374 | 319 |
| 375 RTCOfferOptionsPlatform* parseOfferOptions(const Dictionary& options) { | 320 RTCOfferOptionsPlatform* parseOfferOptions(const Dictionary& options) { |
| 376 if (options.isUndefinedOrNull()) | 321 if (options.isUndefinedOrNull()) |
| 377 return 0; | 322 return 0; |
| 378 | 323 |
| 379 Vector<String> propertyNames; | 324 Vector<String> propertyNames; |
| 380 options.getPropertyNames(propertyNames); | 325 options.getPropertyNames(propertyNames); |
| 381 | 326 |
| 382 // Treat |options| as MediaConstraints if it is empty or has "optional" or | 327 // Treat |options| as MediaConstraints if it is empty or has "optional" or |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 if (m_setupFunction) { | 390 if (m_setupFunction) { |
| 446 return (*m_setupFunction)(); | 391 return (*m_setupFunction)(); |
| 447 } | 392 } |
| 448 return true; | 393 return true; |
| 449 } | 394 } |
| 450 | 395 |
| 451 DEFINE_TRACE(RTCPeerConnection::EventWrapper) { | 396 DEFINE_TRACE(RTCPeerConnection::EventWrapper) { |
| 452 visitor->trace(m_event); | 397 visitor->trace(m_event); |
| 453 } | 398 } |
| 454 | 399 |
| 455 RTCPeerConnection* RTCPeerConnection::create(ExecutionContext* context, | 400 RTCPeerConnection* RTCPeerConnection::create( |
| 456 const Dictionary& rtcConfiguration, | 401 ExecutionContext* context, |
| 457 const Dictionary& mediaConstraints, | 402 const RTCConfiguration& rtcConfiguration, |
| 458 ExceptionState& exceptionState) { | 403 const Dictionary& mediaConstraints, |
| 404 ExceptionState& exceptionState) { |
| 459 if (mediaConstraints.isObject()) | 405 if (mediaConstraints.isObject()) |
| 460 UseCounter::count(context, | 406 UseCounter::count(context, |
| 461 UseCounter::RTCPeerConnectionConstructorConstraints); | 407 UseCounter::RTCPeerConnectionConstructorConstraints); |
| 462 else | 408 else |
| 463 UseCounter::count(context, | 409 UseCounter::count(context, |
| 464 UseCounter::RTCPeerConnectionConstructorCompliant); | 410 UseCounter::RTCPeerConnectionConstructorCompliant); |
| 465 | 411 |
| 466 // Record the RtcpMuxPolicy for histogram | 412 // Record the RtcpMuxPolicy for histogram |
| 467 // "WebRTC.PeerConnection.SelectedRtcpMuxPolicy". | 413 // "WebRTC.PeerConnection.SelectedRtcpMuxPolicy". |
| 468 RtcpMuxPolicy selectedRtcpMuxPolicy = RtcpMuxPolicyDefault; | 414 RtcpMuxPolicy selectedRtcpMuxPolicy = RtcpMuxPolicyDefault; |
| 469 WebRTCConfiguration configuration = parseConfiguration( | 415 WebRTCConfiguration configuration = parseConfiguration( |
| 470 rtcConfiguration, exceptionState, &selectedRtcpMuxPolicy); | 416 context, rtcConfiguration, exceptionState, &selectedRtcpMuxPolicy); |
| 471 if (exceptionState.hadException()) | 417 if (exceptionState.hadException()) |
| 472 return 0; | 418 return 0; |
| 473 | 419 |
| 474 // Make sure no certificates have expired. | 420 // Make sure no certificates have expired. |
| 475 if (configuration.certificates.size() > 0) { | 421 if (configuration.certificates.size() > 0) { |
| 476 DOMTimeStamp now = convertSecondsToDOMTimeStamp(currentTime()); | 422 DOMTimeStamp now = convertSecondsToDOMTimeStamp(currentTime()); |
| 477 for (const std::unique_ptr<WebRTCCertificate>& certificate : | 423 for (const std::unique_ptr<WebRTCCertificate>& certificate : |
| 478 configuration.certificates) { | 424 configuration.certificates) { |
| 479 DOMTimeStamp expires = certificate->expires(); | 425 DOMTimeStamp expires = certificate->expires(); |
| 480 if (expires <= now) { | 426 if (expires <= now) { |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 | 764 |
| 819 RTCSessionDescription* RTCPeerConnection::remoteDescription() { | 765 RTCSessionDescription* RTCPeerConnection::remoteDescription() { |
| 820 WebRTCSessionDescription webSessionDescription = | 766 WebRTCSessionDescription webSessionDescription = |
| 821 m_peerHandler->remoteDescription(); | 767 m_peerHandler->remoteDescription(); |
| 822 if (webSessionDescription.isNull()) | 768 if (webSessionDescription.isNull()) |
| 823 return nullptr; | 769 return nullptr; |
| 824 | 770 |
| 825 return RTCSessionDescription::create(webSessionDescription); | 771 return RTCSessionDescription::create(webSessionDescription); |
| 826 } | 772 } |
| 827 | 773 |
| 828 void RTCPeerConnection::updateIce(const Dictionary& rtcConfiguration, | 774 void RTCPeerConnection::updateIce(ExecutionContext* context, |
| 775 const RTCConfiguration& rtcConfiguration, |
| 829 const Dictionary& mediaConstraints, | 776 const Dictionary& mediaConstraints, |
| 830 ExceptionState& exceptionState) { | 777 ExceptionState& exceptionState) { |
| 831 if (throwExceptionIfSignalingStateClosed(m_signalingState, exceptionState)) | 778 if (throwExceptionIfSignalingStateClosed(m_signalingState, exceptionState)) |
| 832 return; | 779 return; |
| 833 | 780 |
| 834 RtcpMuxPolicy selectedRtcpMuxPolicy = RtcpMuxPolicyDefault; | 781 RtcpMuxPolicy selectedRtcpMuxPolicy = RtcpMuxPolicyDefault; |
| 835 WebRTCConfiguration configuration = parseConfiguration( | 782 WebRTCConfiguration configuration = parseConfiguration( |
| 836 rtcConfiguration, exceptionState, &selectedRtcpMuxPolicy); | 783 context, rtcConfiguration, exceptionState, &selectedRtcpMuxPolicy); |
| 837 | 784 |
| 838 if (exceptionState.hadException()) | 785 if (exceptionState.hadException()) |
| 839 return; | 786 return; |
| 840 | 787 |
| 841 MediaErrorState mediaErrorState; | 788 MediaErrorState mediaErrorState; |
| 842 if (mediaErrorState.hadException()) { | 789 if (mediaErrorState.hadException()) { |
| 843 mediaErrorState.raiseException(exceptionState); | 790 mediaErrorState.raiseException(exceptionState); |
| 844 return; | 791 return; |
| 845 } | 792 } |
| 846 | 793 |
| (...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1505 DEFINE_TRACE(RTCPeerConnection) { | 1452 DEFINE_TRACE(RTCPeerConnection) { |
| 1506 visitor->trace(m_localStreams); | 1453 visitor->trace(m_localStreams); |
| 1507 visitor->trace(m_remoteStreams); | 1454 visitor->trace(m_remoteStreams); |
| 1508 visitor->trace(m_dispatchScheduledEventRunner); | 1455 visitor->trace(m_dispatchScheduledEventRunner); |
| 1509 visitor->trace(m_scheduledEvents); | 1456 visitor->trace(m_scheduledEvents); |
| 1510 EventTargetWithInlineData::trace(visitor); | 1457 EventTargetWithInlineData::trace(visitor); |
| 1511 ActiveDOMObject::trace(visitor); | 1458 ActiveDOMObject::trace(visitor); |
| 1512 } | 1459 } |
| 1513 | 1460 |
| 1514 } // namespace blink | 1461 } // namespace blink |
| OLD | NEW |