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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 | 567 |
568 void MediaController::scheduleEvent(const AtomicString& eventName) | 568 void MediaController::scheduleEvent(const AtomicString& eventName) |
569 { | 569 { |
570 m_pendingEvents.append(Event::createCancelable(eventName)); | 570 m_pendingEvents.append(Event::createCancelable(eventName)); |
571 if (!m_asyncEventTimer.isActive()) | 571 if (!m_asyncEventTimer.isActive()) |
572 m_asyncEventTimer.startOneShot(0, FROM_HERE); | 572 m_asyncEventTimer.startOneShot(0, FROM_HERE); |
573 } | 573 } |
574 | 574 |
575 void MediaController::asyncEventTimerFired(Timer<MediaController>*) | 575 void MediaController::asyncEventTimerFired(Timer<MediaController>*) |
576 { | 576 { |
577 Vector<RefPtr<Event> > pendingEvents; | 577 WillBeHeapVector<RefPtrWillBeMember<Event> > pendingEvents; |
578 | 578 |
579 m_pendingEvents.swap(pendingEvents); | 579 m_pendingEvents.swap(pendingEvents); |
580 size_t count = pendingEvents.size(); | 580 size_t count = pendingEvents.size(); |
581 for (size_t index = 0; index < count; ++index) | 581 for (size_t index = 0; index < count; ++index) |
582 dispatchEvent(pendingEvents[index].release(), IGNORE_EXCEPTION); | 582 dispatchEvent(pendingEvents[index].release(), IGNORE_EXCEPTION); |
583 } | 583 } |
584 | 584 |
585 void MediaController::clearPositionTimerFired(Timer<MediaController>*) | 585 void MediaController::clearPositionTimerFired(Timer<MediaController>*) |
586 { | 586 { |
587 m_position = MediaPlayer::invalidTime(); | 587 m_position = MediaPlayer::invalidTime(); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 { | 622 { |
623 double now = WTF::currentTime(); | 623 double now = WTF::currentTime(); |
624 double timedelta = now - m_previousTimeupdateTime; | 624 double timedelta = now - m_previousTimeupdateTime; |
625 | 625 |
626 if (timedelta < maxTimeupdateEventFrequency) | 626 if (timedelta < maxTimeupdateEventFrequency) |
627 return; | 627 return; |
628 | 628 |
629 scheduleEvent(EventTypeNames::timeupdate); | 629 scheduleEvent(EventTypeNames::timeupdate); |
630 m_previousTimeupdateTime = now; | 630 m_previousTimeupdateTime = now; |
631 } | 631 } |
OLD | NEW |