| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 exceptionState.throwDOMException(InvalidStateError, kSignalingStateClose
dMessage); | 106 exceptionState.throwDOMException(InvalidStateError, kSignalingStateClose
dMessage); |
| 107 return true; | 107 return true; |
| 108 } | 108 } |
| 109 | 109 |
| 110 return false; | 110 return false; |
| 111 } | 111 } |
| 112 | 112 |
| 113 void asyncCallErrorCallback(RTCPeerConnectionErrorCallback* errorCallback, DOMEx
ception* exception) | 113 void asyncCallErrorCallback(RTCPeerConnectionErrorCallback* errorCallback, DOMEx
ception* exception) |
| 114 { | 114 { |
| 115 DCHECK(errorCallback); | 115 DCHECK(errorCallback); |
| 116 Microtask::enqueueMicrotask(bind(&RTCPeerConnectionErrorCallback::handleEven
t, errorCallback, exception)); | 116 Microtask::enqueueMicrotask(bind(&RTCPeerConnectionErrorCallback::handleEven
t, wrapPersistent(errorCallback), wrapPersistent(exception))); |
| 117 } | 117 } |
| 118 | 118 |
| 119 bool callErrorCallbackIfSignalingStateClosed(RTCPeerConnection::SignalingState s
tate, RTCPeerConnectionErrorCallback* errorCallback) | 119 bool callErrorCallbackIfSignalingStateClosed(RTCPeerConnection::SignalingState s
tate, RTCPeerConnectionErrorCallback* errorCallback) |
| 120 { | 120 { |
| 121 if (state == RTCPeerConnection::SignalingStateClosed) { | 121 if (state == RTCPeerConnection::SignalingStateClosed) { |
| 122 if (errorCallback) | 122 if (errorCallback) |
| 123 asyncCallErrorCallback(errorCallback, DOMException::create(InvalidSt
ateError, kSignalingStateClosedMessage)); | 123 asyncCallErrorCallback(errorCallback, DOMException::create(InvalidSt
ateError, kSignalingStateClosedMessage)); |
| 124 | 124 |
| 125 return true; | 125 return true; |
| 126 } | 126 } |
| (...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 m_iceConnectionState = iceConnectionState; | 1172 m_iceConnectionState = iceConnectionState; |
| 1173 return true; | 1173 return true; |
| 1174 } | 1174 } |
| 1175 return false; | 1175 return false; |
| 1176 } | 1176 } |
| 1177 | 1177 |
| 1178 void RTCPeerConnection::changeIceConnectionState(ICEConnectionState iceConnectio
nState) | 1178 void RTCPeerConnection::changeIceConnectionState(ICEConnectionState iceConnectio
nState) |
| 1179 { | 1179 { |
| 1180 if (m_iceConnectionState != ICEConnectionStateClosed) { | 1180 if (m_iceConnectionState != ICEConnectionStateClosed) { |
| 1181 scheduleDispatchEvent(Event::create(EventTypeNames::iceconnectionstatech
ange), | 1181 scheduleDispatchEvent(Event::create(EventTypeNames::iceconnectionstatech
ange), |
| 1182 WTF::bind(&RTCPeerConnection::setIceConnectionState, this, iceConnec
tionState)); | 1182 WTF::bind(&RTCPeerConnection::setIceConnectionState, wrapPersistent(
this), iceConnectionState)); |
| 1183 } | 1183 } |
| 1184 } | 1184 } |
| 1185 | 1185 |
| 1186 void RTCPeerConnection::closeInternal() | 1186 void RTCPeerConnection::closeInternal() |
| 1187 { | 1187 { |
| 1188 DCHECK(m_signalingState != RTCPeerConnection::SignalingStateClosed); | 1188 DCHECK(m_signalingState != RTCPeerConnection::SignalingStateClosed); |
| 1189 m_peerHandler->stop(); | 1189 m_peerHandler->stop(); |
| 1190 m_closed = true; | 1190 m_closed = true; |
| 1191 | 1191 |
| 1192 changeIceConnectionState(ICEConnectionStateClosed); | 1192 changeIceConnectionState(ICEConnectionStateClosed); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1229 { | 1229 { |
| 1230 visitor->trace(m_localStreams); | 1230 visitor->trace(m_localStreams); |
| 1231 visitor->trace(m_remoteStreams); | 1231 visitor->trace(m_remoteStreams); |
| 1232 visitor->trace(m_dispatchScheduledEventRunner); | 1232 visitor->trace(m_dispatchScheduledEventRunner); |
| 1233 visitor->trace(m_scheduledEvents); | 1233 visitor->trace(m_scheduledEvents); |
| 1234 EventTargetWithInlineData::trace(visitor); | 1234 EventTargetWithInlineData::trace(visitor); |
| 1235 ActiveDOMObject::trace(visitor); | 1235 ActiveDOMObject::trace(visitor); |
| 1236 } | 1236 } |
| 1237 | 1237 |
| 1238 } // namespace blink | 1238 } // namespace blink |
| OLD | NEW |