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