| 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 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 | 814 |
| 815 RTCSessionDescription* RTCPeerConnection::remoteDescription() { | 815 RTCSessionDescription* RTCPeerConnection::remoteDescription() { |
| 816 WebRTCSessionDescription webSessionDescription = | 816 WebRTCSessionDescription webSessionDescription = |
| 817 m_peerHandler->remoteDescription(); | 817 m_peerHandler->remoteDescription(); |
| 818 if (webSessionDescription.isNull()) | 818 if (webSessionDescription.isNull()) |
| 819 return nullptr; | 819 return nullptr; |
| 820 | 820 |
| 821 return RTCSessionDescription::create(webSessionDescription); | 821 return RTCSessionDescription::create(webSessionDescription); |
| 822 } | 822 } |
| 823 | 823 |
| 824 void RTCPeerConnection::updateIce(ExecutionContext* context, | 824 void RTCPeerConnection::updateIce(const Dictionary& rtcConfiguration, |
| 825 const Dictionary& rtcConfiguration, | |
| 826 const Dictionary& mediaConstraints, | 825 const Dictionary& mediaConstraints, |
| 827 ExceptionState& exceptionState) { | 826 ExceptionState& exceptionState) { |
| 828 if (throwExceptionIfSignalingStateClosed(m_signalingState, exceptionState)) | 827 if (throwExceptionIfSignalingStateClosed(m_signalingState, exceptionState)) |
| 829 return; | 828 return; |
| 830 | 829 |
| 831 RtcpMuxPolicy selectedRtcpMuxPolicy = RtcpMuxPolicyDefault; | 830 RtcpMuxPolicy selectedRtcpMuxPolicy = RtcpMuxPolicyDefault; |
| 832 RTCConfiguration* configuration = parseConfiguration( | 831 RTCConfiguration* configuration = parseConfiguration( |
| 833 rtcConfiguration, exceptionState, &selectedRtcpMuxPolicy); | 832 rtcConfiguration, exceptionState, &selectedRtcpMuxPolicy); |
| 834 | 833 |
| 835 if (exceptionState.hadException()) | 834 if (exceptionState.hadException()) |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1184 UseCounter::count(context, UseCounter::RTCPeerConnectionGetStats); | 1183 UseCounter::count(context, UseCounter::RTCPeerConnectionGetStats); |
| 1185 | 1184 |
| 1186 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); | 1185 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); |
| 1187 ScriptPromise promise = resolver->promise(); | 1186 ScriptPromise promise = resolver->promise(); |
| 1188 m_peerHandler->getStats(WebRTCStatsReportCallbackResolver::create(resolver)); | 1187 m_peerHandler->getStats(WebRTCStatsReportCallbackResolver::create(resolver)); |
| 1189 | 1188 |
| 1190 return promise; | 1189 return promise; |
| 1191 } | 1190 } |
| 1192 | 1191 |
| 1193 RTCDataChannel* RTCPeerConnection::createDataChannel( | 1192 RTCDataChannel* RTCPeerConnection::createDataChannel( |
| 1193 ExecutionContext* context, |
| 1194 String label, | 1194 String label, |
| 1195 const Dictionary& options, | 1195 const Dictionary& options, |
| 1196 ExceptionState& exceptionState) { | 1196 ExceptionState& exceptionState) { |
| 1197 if (throwExceptionIfSignalingStateClosed(m_signalingState, exceptionState)) | 1197 if (throwExceptionIfSignalingStateClosed(m_signalingState, exceptionState)) |
| 1198 return nullptr; | 1198 return nullptr; |
| 1199 | 1199 |
| 1200 WebRTCDataChannelInit init; | 1200 WebRTCDataChannelInit init; |
| 1201 DictionaryHelper::get(options, "ordered", init.ordered); | 1201 DictionaryHelper::get(options, "ordered", init.ordered); |
| 1202 DictionaryHelper::get(options, "negotiated", init.negotiated); | 1202 DictionaryHelper::get(options, "negotiated", init.negotiated); |
| 1203 | 1203 |
| 1204 unsigned short value = 0; | 1204 unsigned short value = 0; |
| 1205 if (DictionaryHelper::get(options, "id", value)) | 1205 if (DictionaryHelper::get(options, "id", value)) |
| 1206 init.id = value; | 1206 init.id = value; |
| 1207 if (DictionaryHelper::get(options, "maxRetransmits", value)) | 1207 if (DictionaryHelper::get(options, "maxRetransmits", value)) { |
| 1208 UseCounter::count( |
| 1209 context, UseCounter::RTCPeerConnectionCreateDataChannelMaxRetransmits); |
| 1208 init.maxRetransmits = value; | 1210 init.maxRetransmits = value; |
| 1209 if (DictionaryHelper::get(options, "maxRetransmitTime", value)) | 1211 } |
| 1212 if (DictionaryHelper::get(options, "maxRetransmitTime", value)) { |
| 1213 UseCounter::count( |
| 1214 context, |
| 1215 UseCounter::RTCPeerConnectionCreateDataChannelMaxRetransmitTime); |
| 1210 init.maxRetransmitTime = value; | 1216 init.maxRetransmitTime = value; |
| 1217 } |
| 1211 | 1218 |
| 1212 String protocolString; | 1219 String protocolString; |
| 1213 DictionaryHelper::get(options, "protocol", protocolString); | 1220 DictionaryHelper::get(options, "protocol", protocolString); |
| 1214 init.protocol = protocolString; | 1221 init.protocol = protocolString; |
| 1215 | 1222 |
| 1216 RTCDataChannel* channel = RTCDataChannel::create( | 1223 RTCDataChannel* channel = RTCDataChannel::create( |
| 1217 getExecutionContext(), m_peerHandler.get(), label, init, exceptionState); | 1224 getExecutionContext(), m_peerHandler.get(), label, init, exceptionState); |
| 1218 if (exceptionState.hadException()) | 1225 if (exceptionState.hadException()) |
| 1219 return nullptr; | 1226 return nullptr; |
| 1220 RTCDataChannel::ReadyState handlerState = channel->getHandlerState(); | 1227 RTCDataChannel::ReadyState handlerState = channel->getHandlerState(); |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1494 DEFINE_TRACE(RTCPeerConnection) { | 1501 DEFINE_TRACE(RTCPeerConnection) { |
| 1495 visitor->trace(m_localStreams); | 1502 visitor->trace(m_localStreams); |
| 1496 visitor->trace(m_remoteStreams); | 1503 visitor->trace(m_remoteStreams); |
| 1497 visitor->trace(m_dispatchScheduledEventRunner); | 1504 visitor->trace(m_dispatchScheduledEventRunner); |
| 1498 visitor->trace(m_scheduledEvents); | 1505 visitor->trace(m_scheduledEvents); |
| 1499 EventTargetWithInlineData::trace(visitor); | 1506 EventTargetWithInlineData::trace(visitor); |
| 1500 ActiveDOMObject::trace(visitor); | 1507 ActiveDOMObject::trace(visitor); |
| 1501 } | 1508 } |
| 1502 | 1509 |
| 1503 } // namespace blink | 1510 } // namespace blink |
| OLD | NEW |