| 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 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 } | 682 } |
| 683 | 683 |
| 684 void RTCPeerConnection::changeIceConnectionState(ICEConnectionState iceConnectio
nState) | 684 void RTCPeerConnection::changeIceConnectionState(ICEConnectionState iceConnectio
nState) |
| 685 { | 685 { |
| 686 if (m_iceConnectionState != ICEConnectionStateClosed && m_iceConnectionState
!= iceConnectionState) { | 686 if (m_iceConnectionState != ICEConnectionStateClosed && m_iceConnectionState
!= iceConnectionState) { |
| 687 m_iceConnectionState = iceConnectionState; | 687 m_iceConnectionState = iceConnectionState; |
| 688 scheduleDispatchEvent(Event::create(EventTypeNames::iceconnectionstatech
ange)); | 688 scheduleDispatchEvent(Event::create(EventTypeNames::iceconnectionstatech
ange)); |
| 689 } | 689 } |
| 690 } | 690 } |
| 691 | 691 |
| 692 void RTCPeerConnection::scheduleDispatchEvent(PassRefPtr<Event> event) | 692 void RTCPeerConnection::scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event> even
t) |
| 693 { | 693 { |
| 694 m_scheduledEvents.append(event); | 694 m_scheduledEvents.append(event); |
| 695 | 695 |
| 696 m_dispatchScheduledEventRunner.runAsync(); | 696 m_dispatchScheduledEventRunner.runAsync(); |
| 697 } | 697 } |
| 698 | 698 |
| 699 void RTCPeerConnection::dispatchScheduledEvent() | 699 void RTCPeerConnection::dispatchScheduledEvent() |
| 700 { | 700 { |
| 701 if (m_stopped) | 701 if (m_stopped) |
| 702 return; | 702 return; |
| 703 | 703 |
| 704 Vector<RefPtr<Event> > events; | 704 WillBeHeapVector<RefPtrWillBeMember<Event> > events; |
| 705 events.swap(m_scheduledEvents); | 705 events.swap(m_scheduledEvents); |
| 706 | 706 |
| 707 Vector<RefPtr<Event> >::iterator it = events.begin(); | 707 WillBeHeapVector<RefPtrWillBeMember<Event> >::iterator it = events.begin(); |
| 708 for (; it != events.end(); ++it) | 708 for (; it != events.end(); ++it) |
| 709 dispatchEvent((*it).release()); | 709 dispatchEvent((*it).release()); |
| 710 | 710 |
| 711 events.clear(); | 711 events.clear(); |
| 712 } | 712 } |
| 713 | 713 |
| 714 } // namespace WebCore | 714 } // namespace WebCore |
| OLD | NEW |