| OLD | NEW | 
|     1 /* |     1 /* | 
|     2  * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights 
      reserved. |     2  * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   494  |   494  | 
|   495     if ((actionType & LoadMediaResource) && !(m_pendingActionFlags & LoadMediaRe
      source)) { |   495     if ((actionType & LoadMediaResource) && !(m_pendingActionFlags & LoadMediaRe
      source)) { | 
|   496         prepareForLoad(); |   496         prepareForLoad(); | 
|   497         m_pendingActionFlags |= LoadMediaResource; |   497         m_pendingActionFlags |= LoadMediaResource; | 
|   498     } |   498     } | 
|   499  |   499  | 
|   500     if (RuntimeEnabledFeatures::videoTrackEnabled() && (actionType & LoadTextTra
      ckResource)) |   500     if (RuntimeEnabledFeatures::videoTrackEnabled() && (actionType & LoadTextTra
      ckResource)) | 
|   501         m_pendingActionFlags |= LoadTextTrackResource; |   501         m_pendingActionFlags |= LoadTextTrackResource; | 
|   502  |   502  | 
|   503     if (!m_loadTimer.isActive()) |   503     if (!m_loadTimer.isActive()) | 
|   504         m_loadTimer.startOneShot(0); |   504         m_loadTimer.startOneShot(0, FROM_HERE); | 
|   505 } |   505 } | 
|   506  |   506  | 
|   507 void HTMLMediaElement::scheduleNextSourceChild() |   507 void HTMLMediaElement::scheduleNextSourceChild() | 
|   508 { |   508 { | 
|   509     // Schedule the timer to try the next <source> element WITHOUT resetting sta
      te ala prepareForLoad. |   509     // Schedule the timer to try the next <source> element WITHOUT resetting sta
      te ala prepareForLoad. | 
|   510     m_pendingActionFlags |= LoadMediaResource; |   510     m_pendingActionFlags |= LoadMediaResource; | 
|   511     m_loadTimer.startOneShot(0); |   511     m_loadTimer.startOneShot(0, FROM_HERE); | 
|   512 } |   512 } | 
|   513  |   513  | 
|   514 void HTMLMediaElement::scheduleEvent(const AtomicString& eventName) |   514 void HTMLMediaElement::scheduleEvent(const AtomicString& eventName) | 
|   515 { |   515 { | 
|   516     scheduleEvent(Event::createCancelable(eventName)); |   516     scheduleEvent(Event::createCancelable(eventName)); | 
|   517 } |   517 } | 
|   518  |   518  | 
|   519 void HTMLMediaElement::scheduleEvent(PassRefPtr<Event> event) |   519 void HTMLMediaElement::scheduleEvent(PassRefPtr<Event> event) | 
|   520 { |   520 { | 
|   521 #if LOG_MEDIA_EVENTS |   521 #if LOG_MEDIA_EVENTS | 
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1306     return true; |  1306     return true; | 
|  1307 } |  1307 } | 
|  1308  |  1308  | 
|  1309 void HTMLMediaElement::startProgressEventTimer() |  1309 void HTMLMediaElement::startProgressEventTimer() | 
|  1310 { |  1310 { | 
|  1311     if (m_progressEventTimer.isActive()) |  1311     if (m_progressEventTimer.isActive()) | 
|  1312         return; |  1312         return; | 
|  1313  |  1313  | 
|  1314     m_previousProgressTime = WTF::currentTime(); |  1314     m_previousProgressTime = WTF::currentTime(); | 
|  1315     // 350ms is not magic, it is in the spec! |  1315     // 350ms is not magic, it is in the spec! | 
|  1316     m_progressEventTimer.startRepeating(0.350); |  1316     m_progressEventTimer.startRepeating(0.350, FROM_HERE); | 
|  1317 } |  1317 } | 
|  1318  |  1318  | 
|  1319 void HTMLMediaElement::waitForSourceChange() |  1319 void HTMLMediaElement::waitForSourceChange() | 
|  1320 { |  1320 { | 
|  1321     WTF_LOG(Media, "HTMLMediaElement::waitForSourceChange"); |  1321     WTF_LOG(Media, "HTMLMediaElement::waitForSourceChange"); | 
|  1322  |  1322  | 
|  1323     stopPeriodicTimers(); |  1323     stopPeriodicTimers(); | 
|  1324     m_loadState = WaitingForSource; |  1324     m_loadState = WaitingForSource; | 
|  1325  |  1325  | 
|  1326     // 6.17 - Waiting: Set the element's networkState attribute to the NETWORK_N
      O_SOURCE value |  1326     // 6.17 - Waiting: Set the element's networkState attribute to the NETWORK_N
      O_SOURCE value | 
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2129 // The spec says to fire periodic timeupdate events (those sent while playing) e
      very |  2129 // The spec says to fire periodic timeupdate events (those sent while playing) e
      very | 
|  2130 // "15 to 250ms", we choose the slowest frequency |  2130 // "15 to 250ms", we choose the slowest frequency | 
|  2131 static const double maxTimeupdateEventFrequency = 0.25; |  2131 static const double maxTimeupdateEventFrequency = 0.25; | 
|  2132  |  2132  | 
|  2133 void HTMLMediaElement::startPlaybackProgressTimer() |  2133 void HTMLMediaElement::startPlaybackProgressTimer() | 
|  2134 { |  2134 { | 
|  2135     if (m_playbackProgressTimer.isActive()) |  2135     if (m_playbackProgressTimer.isActive()) | 
|  2136         return; |  2136         return; | 
|  2137  |  2137  | 
|  2138     m_previousProgressTime = WTF::currentTime(); |  2138     m_previousProgressTime = WTF::currentTime(); | 
|  2139     m_playbackProgressTimer.startRepeating(maxTimeupdateEventFrequency); |  2139     m_playbackProgressTimer.startRepeating(maxTimeupdateEventFrequency, FROM_HER
      E); | 
|  2140 } |  2140 } | 
|  2141  |  2141  | 
|  2142 void HTMLMediaElement::playbackProgressTimerFired(Timer<HTMLMediaElement>*) |  2142 void HTMLMediaElement::playbackProgressTimerFired(Timer<HTMLMediaElement>*) | 
|  2143 { |  2143 { | 
|  2144     ASSERT(m_player); |  2144     ASSERT(m_player); | 
|  2145  |  2145  | 
|  2146     if (m_fragmentEndTime != MediaPlayer::invalidTime() && currentTime() >= m_fr
      agmentEndTime && m_playbackRate > 0) { |  2146     if (m_fragmentEndTime != MediaPlayer::invalidTime() && currentTime() >= m_fr
      agmentEndTime && m_playbackRate > 0) { | 
|  2147         m_fragmentEndTime = MediaPlayer::invalidTime(); |  2147         m_fragmentEndTime = MediaPlayer::invalidTime(); | 
|  2148         if (!m_mediaController && !m_paused) { |  2148         if (!m_mediaController && !m_paused) { | 
|  2149             UseCounter::count(document(), UseCounter::HTMLMediaElementPauseAtFra
      gmentEnd); |  2149             UseCounter::count(document(), UseCounter::HTMLMediaElementPauseAtFra
      gmentEnd); | 
| (...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  3632 { |  3632 { | 
|  3633     m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); |  3633     m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); | 
|  3634 } |  3634 } | 
|  3635  |  3635  | 
|  3636 bool HTMLMediaElement::isInteractiveContent() const |  3636 bool HTMLMediaElement::isInteractiveContent() const | 
|  3637 { |  3637 { | 
|  3638     return fastHasAttribute(controlsAttr); |  3638     return fastHasAttribute(controlsAttr); | 
|  3639 } |  3639 } | 
|  3640  |  3640  | 
|  3641 } |  3641 } | 
| OLD | NEW |