| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 | 592 |
| 593 void MediaController::scheduleEvent(const AtomicString& eventName) | 593 void MediaController::scheduleEvent(const AtomicString& eventName) |
| 594 { | 594 { |
| 595 m_pendingEvents.append(Event::createCancelable(eventName)); | 595 m_pendingEvents.append(Event::createCancelable(eventName)); |
| 596 if (!m_asyncEventTimer.isActive()) | 596 if (!m_asyncEventTimer.isActive()) |
| 597 m_asyncEventTimer.startOneShot(0, FROM_HERE); | 597 m_asyncEventTimer.startOneShot(0, FROM_HERE); |
| 598 } | 598 } |
| 599 | 599 |
| 600 void MediaController::asyncEventTimerFired(Timer<MediaController>*) | 600 void MediaController::asyncEventTimerFired(Timer<MediaController>*) |
| 601 { | 601 { |
| 602 Vector<RefPtr<Event> > pendingEvents; | 602 WillBeHeapVector<RefPtrWillBeMember<Event> > pendingEvents; |
| 603 | 603 |
| 604 m_pendingEvents.swap(pendingEvents); | 604 m_pendingEvents.swap(pendingEvents); |
| 605 size_t count = pendingEvents.size(); | 605 size_t count = pendingEvents.size(); |
| 606 for (size_t index = 0; index < count; ++index) | 606 for (size_t index = 0; index < count; ++index) |
| 607 dispatchEvent(pendingEvents[index].release(), IGNORE_EXCEPTION); | 607 dispatchEvent(pendingEvents[index].release(), IGNORE_EXCEPTION); |
| 608 } | 608 } |
| 609 | 609 |
| 610 void MediaController::clearPositionTimerFired(Timer<MediaController>*) | 610 void MediaController::clearPositionTimerFired(Timer<MediaController>*) |
| 611 { | 611 { |
| 612 m_position = MediaPlayer::invalidTime(); | 612 m_position = MediaPlayer::invalidTime(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 638 { | 638 { |
| 639 double now = WTF::currentTime(); | 639 double now = WTF::currentTime(); |
| 640 double timedelta = now - m_previousTimeupdateTime; | 640 double timedelta = now - m_previousTimeupdateTime; |
| 641 | 641 |
| 642 if (timedelta < maxTimeupdateEventFrequency) | 642 if (timedelta < maxTimeupdateEventFrequency) |
| 643 return; | 643 return; |
| 644 | 644 |
| 645 scheduleEvent(EventTypeNames::timeupdate); | 645 scheduleEvent(EventTypeNames::timeupdate); |
| 646 m_previousTimeupdateTime = now; | 646 m_previousTimeupdateTime = now; |
| 647 } | 647 } |
| OLD | NEW |