| 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 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 | 748 |
| 749 void RTCPeerConnection::stop() | 749 void RTCPeerConnection::stop() |
| 750 { | 750 { |
| 751 if (m_stopped) | 751 if (m_stopped) |
| 752 return; | 752 return; |
| 753 | 753 |
| 754 m_stopped = true; | 754 m_stopped = true; |
| 755 m_iceConnectionState = ICEConnectionStateClosed; | 755 m_iceConnectionState = ICEConnectionStateClosed; |
| 756 m_signalingState = SignalingStateClosed; | 756 m_signalingState = SignalingStateClosed; |
| 757 | 757 |
| 758 HeapVector<Member<RTCDataChannel> >::iterator i = m_dataChannels.begin(); | 758 HeapVector<Member<RTCDataChannel>>::iterator i = m_dataChannels.begin(); |
| 759 for (; i != m_dataChannels.end(); ++i) | 759 for (; i != m_dataChannels.end(); ++i) |
| 760 (*i)->stop(); | 760 (*i)->stop(); |
| 761 m_dataChannels.clear(); | 761 m_dataChannels.clear(); |
| 762 | 762 |
| 763 m_dispatchScheduledEventRunner.stop(); | 763 m_dispatchScheduledEventRunner.stop(); |
| 764 | 764 |
| 765 m_peerHandler.clear(); | 765 m_peerHandler.clear(); |
| 766 } | 766 } |
| 767 | 767 |
| 768 void RTCPeerConnection::changeSignalingState(SignalingState signalingState) | 768 void RTCPeerConnection::changeSignalingState(SignalingState signalingState) |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 m_scheduledEvents.append(event); | 802 m_scheduledEvents.append(event); |
| 803 | 803 |
| 804 m_dispatchScheduledEventRunner.runAsync(); | 804 m_dispatchScheduledEventRunner.runAsync(); |
| 805 } | 805 } |
| 806 | 806 |
| 807 void RTCPeerConnection::dispatchScheduledEvent() | 807 void RTCPeerConnection::dispatchScheduledEvent() |
| 808 { | 808 { |
| 809 if (m_stopped) | 809 if (m_stopped) |
| 810 return; | 810 return; |
| 811 | 811 |
| 812 WillBeHeapVector<RefPtrWillBeMember<Event> > events; | 812 WillBeHeapVector<RefPtrWillBeMember<Event>> events; |
| 813 events.swap(m_scheduledEvents); | 813 events.swap(m_scheduledEvents); |
| 814 | 814 |
| 815 WillBeHeapVector<RefPtrWillBeMember<Event> >::iterator it = events.begin(); | 815 WillBeHeapVector<RefPtrWillBeMember<Event>>::iterator it = events.begin(); |
| 816 for (; it != events.end(); ++it) | 816 for (; it != events.end(); ++it) |
| 817 dispatchEvent((*it).release()); | 817 dispatchEvent((*it).release()); |
| 818 | 818 |
| 819 events.clear(); | 819 events.clear(); |
| 820 } | 820 } |
| 821 | 821 |
| 822 void RTCPeerConnection::trace(Visitor* visitor) | 822 void RTCPeerConnection::trace(Visitor* visitor) |
| 823 { | 823 { |
| 824 visitor->trace(m_localStreams); | 824 visitor->trace(m_localStreams); |
| 825 visitor->trace(m_remoteStreams); | 825 visitor->trace(m_remoteStreams); |
| 826 visitor->trace(m_dataChannels); | 826 visitor->trace(m_dataChannels); |
| 827 #if ENABLE(OILPAN) | 827 #if ENABLE(OILPAN) |
| 828 visitor->trace(m_scheduledEvents); | 828 visitor->trace(m_scheduledEvents); |
| 829 #endif | 829 #endif |
| 830 RefCountedGarbageCollectedEventTargetWithInlineData<RTCPeerConnection>::trac
e(visitor); | 830 RefCountedGarbageCollectedEventTargetWithInlineData<RTCPeerConnection>::trac
e(visitor); |
| 831 ActiveDOMObject::trace(visitor); | 831 ActiveDOMObject::trace(visitor); |
| 832 } | 832 } |
| 833 | 833 |
| 834 } // namespace blink | 834 } // namespace blink |
| OLD | NEW |