| 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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 { | 460 { |
| 461 // This checks that close() or stop() is called before the destructor. | 461 // This checks that close() or stop() is called before the destructor. |
| 462 // We are assuming that a wrapper is always created when RTCPeerConnection i
s created. | 462 // We are assuming that a wrapper is always created when RTCPeerConnection i
s created. |
| 463 DCHECK(m_closed || m_stopped); | 463 DCHECK(m_closed || m_stopped); |
| 464 } | 464 } |
| 465 | 465 |
| 466 void RTCPeerConnection::dispose() | 466 void RTCPeerConnection::dispose() |
| 467 { | 467 { |
| 468 // Promptly clears a raw reference from content/ to an on-heap object | 468 // Promptly clears a raw reference from content/ to an on-heap object |
| 469 // so that content/ doesn't access it in a lazy sweeping phase. | 469 // so that content/ doesn't access it in a lazy sweeping phase. |
| 470 m_peerHandler.clear(); | 470 m_peerHandler.reset(); |
| 471 } | 471 } |
| 472 | 472 |
| 473 ScriptPromise RTCPeerConnection::createOffer(ScriptState* scriptState, const RTC
OfferOptions& options) | 473 ScriptPromise RTCPeerConnection::createOffer(ScriptState* scriptState, const RTC
OfferOptions& options) |
| 474 { | 474 { |
| 475 if (m_signalingState == SignalingStateClosed) | 475 if (m_signalingState == SignalingStateClosed) |
| 476 return ScriptPromise::rejectWithDOMException(scriptState, DOMException::
create(InvalidStateError, kSignalingStateClosedMessage)); | 476 return ScriptPromise::rejectWithDOMException(scriptState, DOMException::
create(InvalidStateError, kSignalingStateClosedMessage)); |
| 477 | 477 |
| 478 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState)
; | 478 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState)
; |
| 479 ScriptPromise promise = resolver->promise(); | 479 ScriptPromise promise = resolver->promise(); |
| 480 RTCSessionDescriptionRequest* request = RTCSessionDescriptionRequestPromiseI
mpl::create(this, resolver); | 480 RTCSessionDescriptionRequest* request = RTCSessionDescriptionRequestPromiseI
mpl::create(this, resolver); |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1127 { | 1127 { |
| 1128 if (m_stopped) | 1128 if (m_stopped) |
| 1129 return; | 1129 return; |
| 1130 | 1130 |
| 1131 m_stopped = true; | 1131 m_stopped = true; |
| 1132 m_iceConnectionState = ICEConnectionStateClosed; | 1132 m_iceConnectionState = ICEConnectionStateClosed; |
| 1133 m_signalingState = SignalingStateClosed; | 1133 m_signalingState = SignalingStateClosed; |
| 1134 | 1134 |
| 1135 m_dispatchScheduledEventRunner->stop(); | 1135 m_dispatchScheduledEventRunner->stop(); |
| 1136 | 1136 |
| 1137 m_peerHandler.clear(); | 1137 m_peerHandler.reset(); |
| 1138 } | 1138 } |
| 1139 | 1139 |
| 1140 void RTCPeerConnection::changeSignalingState(SignalingState signalingState) | 1140 void RTCPeerConnection::changeSignalingState(SignalingState signalingState) |
| 1141 { | 1141 { |
| 1142 if (m_signalingState != SignalingStateClosed && m_signalingState != signalin
gState) { | 1142 if (m_signalingState != SignalingStateClosed && m_signalingState != signalin
gState) { |
| 1143 m_signalingState = signalingState; | 1143 m_signalingState = signalingState; |
| 1144 scheduleDispatchEvent(Event::create(EventTypeNames::signalingstatechange
)); | 1144 scheduleDispatchEvent(Event::create(EventTypeNames::signalingstatechange
)); |
| 1145 } | 1145 } |
| 1146 } | 1146 } |
| 1147 | 1147 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1213 { | 1213 { |
| 1214 visitor->trace(m_localStreams); | 1214 visitor->trace(m_localStreams); |
| 1215 visitor->trace(m_remoteStreams); | 1215 visitor->trace(m_remoteStreams); |
| 1216 visitor->trace(m_dispatchScheduledEventRunner); | 1216 visitor->trace(m_dispatchScheduledEventRunner); |
| 1217 visitor->trace(m_scheduledEvents); | 1217 visitor->trace(m_scheduledEvents); |
| 1218 EventTargetWithInlineData::trace(visitor); | 1218 EventTargetWithInlineData::trace(visitor); |
| 1219 ActiveDOMObject::trace(visitor); | 1219 ActiveDOMObject::trace(visitor); |
| 1220 } | 1220 } |
| 1221 | 1221 |
| 1222 } // namespace blink | 1222 } // namespace blink |
| OLD | NEW |