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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
213 return; | 213 return; |
214 } | 214 } |
215 } | 215 } |
216 | 216 |
217 RTCPeerConnection::~RTCPeerConnection() | 217 RTCPeerConnection::~RTCPeerConnection() |
218 { | 218 { |
219 // This checks that close() or stop() is called before the destructor. | 219 // This checks that close() or stop() is called before the destructor. |
220 // We are assuming that a wrapper is always created when RTCPeerConnection i s created. | 220 // We are assuming that a wrapper is always created when RTCPeerConnection i s created. |
221 ASSERT(m_closed || m_stopped); | 221 ASSERT(m_closed || m_stopped); |
222 | 222 |
223 // FIXME: Oilpan: We can't call stop here since it touches m_dataChannels. | 223 #if !ENABLE(OILPAN) |
224 // Another way to ensure that data channels are stopped at RTCPeerConnection | |
225 // destruction is needed. | |
226 stop(); | 224 stop(); |
225 #endif | |
227 } | 226 } |
228 | 227 |
229 void RTCPeerConnection::createOffer(PassOwnPtr<RTCSessionDescriptionCallback> su ccessCallback, PassOwnPtr<RTCErrorCallback> errorCallback, const Dictionary& med iaConstraints, ExceptionState& exceptionState) | 228 void RTCPeerConnection::createOffer(PassOwnPtr<RTCSessionDescriptionCallback> su ccessCallback, PassOwnPtr<RTCErrorCallback> errorCallback, const Dictionary& med iaConstraints, ExceptionState& exceptionState) |
230 { | 229 { |
231 if (throwExceptionIfSignalingStateClosed(m_signalingState, exceptionState)) | 230 if (throwExceptionIfSignalingStateClosed(m_signalingState, exceptionState)) |
232 return; | 231 return; |
233 | 232 |
234 ASSERT(successCallback); | 233 ASSERT(successCallback); |
235 | 234 |
236 blink::WebMediaConstraints constraints = MediaConstraintsImpl::create(mediaC onstraints, exceptionState); | 235 blink::WebMediaConstraints constraints = MediaConstraintsImpl::create(mediaC onstraints, exceptionState); |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
735 WillBeHeapVector<RefPtrWillBeMember<Event> > events; | 734 WillBeHeapVector<RefPtrWillBeMember<Event> > events; |
736 events.swap(m_scheduledEvents); | 735 events.swap(m_scheduledEvents); |
737 | 736 |
738 WillBeHeapVector<RefPtrWillBeMember<Event> >::iterator it = events.begin(); | 737 WillBeHeapVector<RefPtrWillBeMember<Event> >::iterator it = events.begin(); |
739 for (; it != events.end(); ++it) | 738 for (; it != events.end(); ++it) |
740 dispatchEvent((*it).release()); | 739 dispatchEvent((*it).release()); |
741 | 740 |
742 events.clear(); | 741 events.clear(); |
743 } | 742 } |
744 | 743 |
744 void RTCPeerConnection::clearWeakMembers(Visitor* visitor) | |
745 { | |
746 if (!visitor->isAlive(this) && m_closed) | |
Mads Ager (chromium)
2014/06/18 08:19:50
This will not work because weak processing only ha
keishi
2014/06/18 08:56:58
Done.
| |
747 stop(); | |
748 } | |
749 | |
745 void RTCPeerConnection::trace(Visitor* visitor) | 750 void RTCPeerConnection::trace(Visitor* visitor) |
746 { | 751 { |
747 visitor->trace(m_localStreams); | 752 visitor->trace(m_localStreams); |
748 visitor->trace(m_remoteStreams); | 753 visitor->trace(m_remoteStreams); |
749 visitor->trace(m_dataChannels); | 754 visitor->trace(m_dataChannels); |
750 visitor->trace(m_scheduledEvents); | 755 visitor->trace(m_scheduledEvents); |
756 visitor->registerWeakMembers<RTCPeerConnection, &RTCPeerConnection::clearWea kMembers>(this); | |
751 EventTargetWithInlineData::trace(visitor); | 757 EventTargetWithInlineData::trace(visitor); |
752 } | 758 } |
753 | 759 |
754 } // namespace WebCore | 760 } // namespace WebCore |
OLD | NEW |