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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 | 507 |
508 if (!document->frame()) { | 508 if (!document->frame()) { |
509 m_closed = true; | 509 m_closed = true; |
510 m_stopped = true; | 510 m_stopped = true; |
511 exceptionState.throwDOMException( | 511 exceptionState.throwDOMException( |
512 NotSupportedError, | 512 NotSupportedError, |
513 "PeerConnections may not be created in detached documents."); | 513 "PeerConnections may not be created in detached documents."); |
514 return; | 514 return; |
515 } | 515 } |
516 | 516 |
517 m_peerHandler = | 517 m_peerHandler = WTF::wrapUnique( |
518 wrapUnique(Platform::current()->createRTCPeerConnectionHandler(this)); | 518 Platform::current()->createRTCPeerConnectionHandler(this)); |
519 if (!m_peerHandler) { | 519 if (!m_peerHandler) { |
520 m_closed = true; | 520 m_closed = true; |
521 m_stopped = true; | 521 m_stopped = true; |
522 exceptionState.throwDOMException(NotSupportedError, | 522 exceptionState.throwDOMException(NotSupportedError, |
523 "No PeerConnection handler can be " | 523 "No PeerConnection handler can be " |
524 "created, perhaps WebRTC is disabled?"); | 524 "created, perhaps WebRTC is disabled?"); |
525 return; | 525 return; |
526 } | 526 } |
527 | 527 |
528 document->frame() | 528 document->frame() |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
917 return ScriptPromise::rejectWithDOMException( | 917 return ScriptPromise::rejectWithDOMException( |
918 scriptState, DOMException::create(NotSupportedError, | 918 scriptState, DOMException::create(NotSupportedError, |
919 "The 1st argument provided is an " | 919 "The 1st argument provided is an " |
920 "AlgorithmIdentifier, but the " | 920 "AlgorithmIdentifier, but the " |
921 "algorithm is not supported.")); | 921 "algorithm is not supported.")); |
922 break; | 922 break; |
923 } | 923 } |
924 DCHECK(!keyParams.isNull()); | 924 DCHECK(!keyParams.isNull()); |
925 | 925 |
926 std::unique_ptr<WebRTCCertificateGenerator> certificateGenerator = | 926 std::unique_ptr<WebRTCCertificateGenerator> certificateGenerator = |
927 wrapUnique(Platform::current()->createRTCCertificateGenerator()); | 927 WTF::wrapUnique(Platform::current()->createRTCCertificateGenerator()); |
928 | 928 |
929 // |keyParams| was successfully constructed, but does the certificate | 929 // |keyParams| was successfully constructed, but does the certificate |
930 // generator support these parameters? | 930 // generator support these parameters? |
931 if (!certificateGenerator->isSupportedKeyParams(keyParams.get())) { | 931 if (!certificateGenerator->isSupportedKeyParams(keyParams.get())) { |
932 return ScriptPromise::rejectWithDOMException( | 932 return ScriptPromise::rejectWithDOMException( |
933 scriptState, | 933 scriptState, |
934 DOMException::create(NotSupportedError, unsupportedParamsString)); | 934 DOMException::create(NotSupportedError, unsupportedParamsString)); |
935 } | 935 } |
936 | 936 |
937 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); | 937 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1337 | 1337 |
1338 void RTCPeerConnection::didAddRemoteDataChannel( | 1338 void RTCPeerConnection::didAddRemoteDataChannel( |
1339 WebRTCDataChannelHandler* handler) { | 1339 WebRTCDataChannelHandler* handler) { |
1340 DCHECK(!m_closed); | 1340 DCHECK(!m_closed); |
1341 DCHECK(getExecutionContext()->isContextThread()); | 1341 DCHECK(getExecutionContext()->isContextThread()); |
1342 | 1342 |
1343 if (m_signalingState == SignalingStateClosed) | 1343 if (m_signalingState == SignalingStateClosed) |
1344 return; | 1344 return; |
1345 | 1345 |
1346 RTCDataChannel* channel = | 1346 RTCDataChannel* channel = |
1347 RTCDataChannel::create(getExecutionContext(), wrapUnique(handler)); | 1347 RTCDataChannel::create(getExecutionContext(), WTF::wrapUnique(handler)); |
1348 scheduleDispatchEvent(RTCDataChannelEvent::create(EventTypeNames::datachannel, | 1348 scheduleDispatchEvent(RTCDataChannelEvent::create(EventTypeNames::datachannel, |
1349 false, false, channel)); | 1349 false, false, channel)); |
1350 m_hasDataChannels = true; | 1350 m_hasDataChannels = true; |
1351 } | 1351 } |
1352 | 1352 |
1353 void RTCPeerConnection::releasePeerConnectionHandler() { | 1353 void RTCPeerConnection::releasePeerConnectionHandler() { |
1354 contextDestroyed(); | 1354 contextDestroyed(); |
1355 } | 1355 } |
1356 | 1356 |
1357 void RTCPeerConnection::closePeerConnection() { | 1357 void RTCPeerConnection::closePeerConnection() { |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1491 DEFINE_TRACE(RTCPeerConnection) { | 1491 DEFINE_TRACE(RTCPeerConnection) { |
1492 visitor->trace(m_localStreams); | 1492 visitor->trace(m_localStreams); |
1493 visitor->trace(m_remoteStreams); | 1493 visitor->trace(m_remoteStreams); |
1494 visitor->trace(m_dispatchScheduledEventRunner); | 1494 visitor->trace(m_dispatchScheduledEventRunner); |
1495 visitor->trace(m_scheduledEvents); | 1495 visitor->trace(m_scheduledEvents); |
1496 EventTargetWithInlineData::trace(visitor); | 1496 EventTargetWithInlineData::trace(visitor); |
1497 ActiveDOMObject::trace(visitor); | 1497 ActiveDOMObject::trace(visitor); |
1498 } | 1498 } |
1499 | 1499 |
1500 } // namespace blink | 1500 } // namespace blink |
OLD | NEW |