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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 } | 144 } |
145 | 145 |
146 double MediaController::currentTime() const | 146 double MediaController::currentTime() const |
147 { | 147 { |
148 if (m_mediaElements.isEmpty()) | 148 if (m_mediaElements.isEmpty()) |
149 return 0; | 149 return 0; |
150 | 150 |
151 if (std::isnan(m_position)) { | 151 if (std::isnan(m_position)) { |
152 // Some clocks may return times outside the range of [0..duration]. | 152 // Some clocks may return times outside the range of [0..duration]. |
153 m_position = std::max(0.0, std::min(duration(), m_clock->currentTime()))
; | 153 m_position = std::max(0.0, std::min(duration(), m_clock->currentTime()))
; |
154 m_clearPositionTimer.startOneShot(0, FROM_HERE); | 154 m_clearPositionTimer.startOneShot(0, BLINK_FROM_HERE); |
155 } | 155 } |
156 | 156 |
157 return m_position; | 157 return m_position; |
158 } | 158 } |
159 | 159 |
160 void MediaController::setCurrentTime(double time) | 160 void MediaController::setCurrentTime(double time) |
161 { | 161 { |
162 // When the user agent is to seek the media controller to a particular new p
layback position, | 162 // When the user agent is to seek the media controller to a particular new p
layback position, |
163 // it must follow these steps: | 163 // it must follow these steps: |
164 // If the new playback position is less than zero, then set it to zero. | 164 // If the new playback position is less than zero, then set it to zero. |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 | 578 |
579 // The spec says to fire periodic timeupdate events (those sent while playing) e
very | 579 // The spec says to fire periodic timeupdate events (those sent while playing) e
very |
580 // "15 to 250ms", we choose the slowest frequency | 580 // "15 to 250ms", we choose the slowest frequency |
581 static const double maxTimeupdateEventFrequency = 0.25; | 581 static const double maxTimeupdateEventFrequency = 0.25; |
582 | 582 |
583 void MediaController::startTimeupdateTimer() | 583 void MediaController::startTimeupdateTimer() |
584 { | 584 { |
585 if (m_timeupdateTimer.isActive()) | 585 if (m_timeupdateTimer.isActive()) |
586 return; | 586 return; |
587 | 587 |
588 m_timeupdateTimer.startRepeating(maxTimeupdateEventFrequency, FROM_HERE); | 588 m_timeupdateTimer.startRepeating(maxTimeupdateEventFrequency, BLINK_FROM_HER
E); |
589 } | 589 } |
590 | 590 |
591 void MediaController::timeupdateTimerFired(Timer<MediaController>*) | 591 void MediaController::timeupdateTimerFired(Timer<MediaController>*) |
592 { | 592 { |
593 scheduleTimeupdateEvent(); | 593 scheduleTimeupdateEvent(); |
594 } | 594 } |
595 | 595 |
596 void MediaController::scheduleTimeupdateEvent() | 596 void MediaController::scheduleTimeupdateEvent() |
597 { | 597 { |
598 double now = WTF::currentTime(); | 598 double now = WTF::currentTime(); |
(...skipping 10 matching lines...) Expand all Loading... |
609 { | 609 { |
610 #if ENABLE(OILPAN) | 610 #if ENABLE(OILPAN) |
611 visitor->trace(m_mediaElements); | 611 visitor->trace(m_mediaElements); |
612 visitor->trace(m_pendingEventsQueue); | 612 visitor->trace(m_pendingEventsQueue); |
613 visitor->trace(m_executionContext); | 613 visitor->trace(m_executionContext); |
614 #endif | 614 #endif |
615 RefCountedGarbageCollectedEventTargetWithInlineData<MediaController>::trace(
visitor); | 615 RefCountedGarbageCollectedEventTargetWithInlineData<MediaController>::trace(
visitor); |
616 } | 616 } |
617 | 617 |
618 } | 618 } |
OLD | NEW |