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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 | 496 |
497 if (!document->GetFrame()) { | 497 if (!document->GetFrame()) { |
498 closed_ = true; | 498 closed_ = true; |
499 stopped_ = true; | 499 stopped_ = true; |
500 exception_state.ThrowDOMException( | 500 exception_state.ThrowDOMException( |
501 kNotSupportedError, | 501 kNotSupportedError, |
502 "PeerConnections may not be created in detached documents."); | 502 "PeerConnections may not be created in detached documents."); |
503 return; | 503 return; |
504 } | 504 } |
505 | 505 |
506 peer_handler_ = WTF::WrapUnique( | 506 peer_handler_ = Platform::Current()->CreateRTCPeerConnectionHandler(this); |
507 Platform::Current()->CreateRTCPeerConnectionHandler(this)); | |
508 if (!peer_handler_) { | 507 if (!peer_handler_) { |
509 closed_ = true; | 508 closed_ = true; |
510 stopped_ = true; | 509 stopped_ = true; |
511 exception_state.ThrowDOMException(kNotSupportedError, | 510 exception_state.ThrowDOMException(kNotSupportedError, |
512 "No PeerConnection handler can be " | 511 "No PeerConnection handler can be " |
513 "created, perhaps WebRTC is disabled?"); | 512 "created, perhaps WebRTC is disabled?"); |
514 return; | 513 return; |
515 } | 514 } |
516 | 515 |
517 document->GetFrame() | 516 document->GetFrame() |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 return ScriptPromise::RejectWithDOMException( | 917 return ScriptPromise::RejectWithDOMException( |
919 script_state, DOMException::Create(kNotSupportedError, | 918 script_state, DOMException::Create(kNotSupportedError, |
920 "The 1st argument provided is an " | 919 "The 1st argument provided is an " |
921 "AlgorithmIdentifier, but the " | 920 "AlgorithmIdentifier, but the " |
922 "algorithm is not supported.")); | 921 "algorithm is not supported.")); |
923 break; | 922 break; |
924 } | 923 } |
925 DCHECK(!key_params.IsNull()); | 924 DCHECK(!key_params.IsNull()); |
926 | 925 |
927 std::unique_ptr<WebRTCCertificateGenerator> certificate_generator = | 926 std::unique_ptr<WebRTCCertificateGenerator> certificate_generator = |
928 WTF::WrapUnique(Platform::Current()->CreateRTCCertificateGenerator()); | 927 Platform::Current()->CreateRTCCertificateGenerator(); |
929 | 928 |
930 // |keyParams| was successfully constructed, but does the certificate | 929 // |keyParams| was successfully constructed, but does the certificate |
931 // generator support these parameters? | 930 // generator support these parameters? |
932 if (!certificate_generator->IsSupportedKeyParams(key_params.Get())) { | 931 if (!certificate_generator->IsSupportedKeyParams(key_params.Get())) { |
933 return ScriptPromise::RejectWithDOMException( | 932 return ScriptPromise::RejectWithDOMException( |
934 script_state, | 933 script_state, |
935 DOMException::Create(kNotSupportedError, unsupported_params_string)); | 934 DOMException::Create(kNotSupportedError, unsupported_params_string)); |
936 } | 935 } |
937 | 936 |
938 ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state); | 937 ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state); |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1553 visitor->Trace(local_streams_); | 1552 visitor->Trace(local_streams_); |
1554 visitor->Trace(remote_streams_); | 1553 visitor->Trace(remote_streams_); |
1555 visitor->Trace(rtp_receivers_); | 1554 visitor->Trace(rtp_receivers_); |
1556 visitor->Trace(dispatch_scheduled_event_runner_); | 1555 visitor->Trace(dispatch_scheduled_event_runner_); |
1557 visitor->Trace(scheduled_events_); | 1556 visitor->Trace(scheduled_events_); |
1558 EventTargetWithInlineData::Trace(visitor); | 1557 EventTargetWithInlineData::Trace(visitor); |
1559 SuspendableObject::Trace(visitor); | 1558 SuspendableObject::Trace(visitor); |
1560 } | 1559 } |
1561 | 1560 |
1562 } // namespace blink | 1561 } // namespace blink |
OLD | NEW |