Title: [119146] trunk/Source
Revision
119146
Author
rafa...@chromium.org
Date
2012-05-31 14:09:01 -0700 (Thu, 31 May 2012)

Log Message

Unreviewed, rolling out r119125.
http://trac.webkit.org/changeset/119125
https://bugs.webkit.org/show_bug.cgi?id=88007

Will break android build if rolled (Requested by rafaelw_ on
#webkit).

Patch by Sheriff Bot <webkit.review....@gmail.com> on 2012-05-31

Source/WebCore:

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::startProgressEventTimer):
(WebCore::HTMLMediaElement::changeNetworkStateFromLoadingToIdle):
(WebCore::HTMLMediaElement::progressEventTimerFired):
(WebCore::HTMLMediaElement::startPlaybackProgressTimer):
* platform/graphics/MediaPlayer.cpp:
(WebCore::NullMediaPlayerPrivate::bytesLoaded):
(WebCore::MediaPlayer::bytesLoaded):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(MediaPlayerPrivateInterface):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
(WebCore::MediaPlayerPrivateAVFoundation::bytesLoaded):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
(MediaPlayerPrivateAVFoundation):
* platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp:
(WebCore::MediaPlayerPrivate::bytesLoaded):
* platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h:
(MediaPlayerPrivate):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::bytesLoaded):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
(MediaPlayerPrivateGStreamer):
* platform/graphics/mac/MediaPlayerPrivateQTKit.h:
(MediaPlayerPrivateQTKit):
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivateQTKit::MediaPlayerPrivateQTKit):
(WebCore::MediaPlayerPrivateQTKit::bytesLoaded):
* platform/graphics/qt/MediaPlayerPrivateQt.cpp:
(WebCore::MediaPlayerPrivateQt::MediaPlayerPrivateQt):
(WebCore::MediaPlayerPrivateQt::bytesLoaded):
* platform/graphics/qt/MediaPlayerPrivateQt.h:
(MediaPlayerPrivateQt):
* platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::MediaPlayerPrivateQuickTimeVisualContext):
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::bytesLoaded):
* platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h:
(MediaPlayerPrivateQuickTimeVisualContext):
* platform/graphics/wince/MediaPlayerPrivateWinCE.h:
(MediaPlayerPrivate):

Source/WebKit/chromium:

* public/WebMediaPlayer.h:
(WebMediaPlayer):
* src/WebMediaPlayerClientImpl.cpp:
(WebKit::WebMediaPlayerClientImpl::bytesLoaded):
* src/WebMediaPlayerClientImpl.h:
(WebMediaPlayerClientImpl):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (119145 => 119146)


--- trunk/Source/WebCore/ChangeLog	2012-05-31 21:03:16 UTC (rev 119145)
+++ trunk/Source/WebCore/ChangeLog	2012-05-31 21:09:01 UTC (rev 119146)
@@ -1,3 +1,56 @@
+2012-05-31  Sheriff Bot  <webkit.review....@gmail.com>
+
+        Unreviewed, rolling out r119125.
+        http://trac.webkit.org/changeset/119125
+        https://bugs.webkit.org/show_bug.cgi?id=88007
+
+        Will break android build if rolled (Requested by rafaelw_ on
+        #webkit).
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::HTMLMediaElement):
+        (WebCore::HTMLMediaElement::startProgressEventTimer):
+        (WebCore::HTMLMediaElement::changeNetworkStateFromLoadingToIdle):
+        (WebCore::HTMLMediaElement::progressEventTimerFired):
+        (WebCore::HTMLMediaElement::startPlaybackProgressTimer):
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::NullMediaPlayerPrivate::bytesLoaded):
+        (WebCore::MediaPlayer::bytesLoaded):
+        * platform/graphics/MediaPlayer.h:
+        * platform/graphics/MediaPlayerPrivate.h:
+        (MediaPlayerPrivateInterface):
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+        (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
+        (WebCore::MediaPlayerPrivateAVFoundation::bytesLoaded):
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
+        (MediaPlayerPrivateAVFoundation):
+        * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp:
+        (WebCore::MediaPlayerPrivate::bytesLoaded):
+        * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h:
+        (MediaPlayerPrivate):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
+        (WebCore::MediaPlayerPrivateGStreamer::bytesLoaded):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+        (MediaPlayerPrivateGStreamer):
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
+        (MediaPlayerPrivateQTKit):
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+        (WebCore::MediaPlayerPrivateQTKit::MediaPlayerPrivateQTKit):
+        (WebCore::MediaPlayerPrivateQTKit::bytesLoaded):
+        * platform/graphics/qt/MediaPlayerPrivateQt.cpp:
+        (WebCore::MediaPlayerPrivateQt::MediaPlayerPrivateQt):
+        (WebCore::MediaPlayerPrivateQt::bytesLoaded):
+        * platform/graphics/qt/MediaPlayerPrivateQt.h:
+        (MediaPlayerPrivateQt):
+        * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
+        (WebCore::MediaPlayerPrivateQuickTimeVisualContext::MediaPlayerPrivateQuickTimeVisualContext):
+        (WebCore::MediaPlayerPrivateQuickTimeVisualContext::bytesLoaded):
+        * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h:
+        (MediaPlayerPrivateQuickTimeVisualContext):
+        * platform/graphics/wince/MediaPlayerPrivateWinCE.h:
+        (MediaPlayerPrivate):
+
 2012-05-31  Andy Estes  <aes...@apple.com>
 
         Disentangle code that relies on USE(AUTOMATIC_TEXT_REPLACEMENT) from that which merely relies on PLATFORM(MAC)

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (119145 => 119146)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2012-05-31 21:03:16 UTC (rev 119145)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2012-05-31 21:09:01 UTC (rev 119146)
@@ -210,6 +210,7 @@
     , m_readyStateMaximum(HAVE_NOTHING)
     , m_volume(1.0f)
     , m_lastSeekTime(0)
+    , m_previousProgress(0)
     , m_previousProgressTime(numeric_limits<double>::max())
     , m_lastTimeUpdateEventWallTime(0)
     , m_lastTimeUpdateEventMovieTime(numeric_limits<float>::max())
@@ -1376,6 +1377,7 @@
         return;
 
     m_previousProgressTime = WTF::currentTime();
+    m_previousProgress = 0;
     // 350ms is not magic, it is in the spec!
     m_progressEventTimer.startRepeating(0.350);
 }
@@ -1582,7 +1584,7 @@
 void HTMLMediaElement::changeNetworkStateFromLoadingToIdle()
 {
     m_progressEventTimer.stop();
-    if (hasMediaControls() && m_player->didLoadingProgress())
+    if (hasMediaControls() && m_player->bytesLoaded() != m_previousProgress)
         mediaControls()->bufferingProgressed();
 
     // Schedule one last progress event so we guarantee that at least one is fired
@@ -1835,21 +1837,25 @@
     if (m_networkState != NETWORK_LOADING)
         return;
 
+    unsigned progress = m_player->bytesLoaded();
     double time = WTF::currentTime();
     double timedelta = time - m_previousProgressTime;
 
-    if (m_player->didLoadingProgress()) {
+    if (progress == m_previousProgress) {
+        if (timedelta > 3.0 && !m_sentStalledEvent) {
+            scheduleEvent(eventNames().stalledEvent);
+            m_sentStalledEvent = true;
+            setShouldDelayLoadEvent(false);
+        }
+    } else {
         scheduleEvent(eventNames().progressEvent);
+        m_previousProgress = progress;
         m_previousProgressTime = time;
         m_sentStalledEvent = false;
         if (renderer())
             renderer()->updateFromElement();
         if (hasMediaControls())
             mediaControls()->bufferingProgressed();
-    } else if (timedelta > 3.0 && !m_sentStalledEvent) {
-        scheduleEvent(eventNames().stalledEvent);
-        m_sentStalledEvent = true;
-        setShouldDelayLoadEvent(false);
     }
 }
 
@@ -2717,6 +2723,7 @@
         return;
 
     m_previousProgressTime = WTF::currentTime();
+    m_previousProgress = 0;
     m_playbackProgressTimer.startRepeating(maxTimeupdateEventFrequency);
 }
 

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (119145 => 119146)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2012-05-31 21:03:16 UTC (rev 119145)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2012-05-31 21:09:01 UTC (rev 119146)
@@ -131,7 +131,7 @@
     virtual PassRefPtr<TimeRanges> buffered() const { return TimeRanges::create(); }
 
     virtual unsigned totalBytes() const { return 0; }
-    virtual bool didLoadingProgress() const { return false; }
+    virtual unsigned bytesLoaded() const { return 0; }
 
     virtual void setSize(const IntSize&) { }
 
@@ -681,9 +681,9 @@
     return m_private->maxTimeSeekable();
 }
 
-bool MediaPlayer::didLoadingProgress()
+unsigned MediaPlayer::bytesLoaded()
 {
-    return m_private->didLoadingProgress();
+    return m_private->bytesLoaded();
 }
 
 void MediaPlayer::setSize(const IntSize& size)

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (119145 => 119146)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h	2012-05-31 21:03:16 UTC (rev 119145)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h	2012-05-31 21:09:01 UTC (rev 119146)
@@ -278,7 +278,7 @@
     PassRefPtr<TimeRanges> seekable();
     float maxTimeSeekable();
 
-    bool didLoadingProgress();
+    unsigned bytesLoaded();
 
     float volume() const;
     void setVolume(float);

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h (119145 => 119146)


--- trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h	2012-05-31 21:03:16 UTC (rev 119145)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h	2012-05-31 21:09:01 UTC (rev 119146)
@@ -96,7 +96,7 @@
     virtual float maxTimeSeekable() const = 0;
     virtual PassRefPtr<TimeRanges> buffered() const = 0;
 
-    virtual bool didLoadingProgress() const = 0;
+    virtual unsigned bytesLoaded() const = 0;
 
     virtual void setSize(const IntSize&) = 0;
 

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (119145 => 119146)


--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp	2012-05-31 21:03:16 UTC (rev 119145)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp	2012-05-31 21:09:01 UTC (rev 119146)
@@ -57,7 +57,6 @@
     , m_cachedMaxTimeSeekable(0)
     , m_cachedDuration(invalidTime())
     , m_reportedDuration(invalidTime())
-    , m_maxTimeLoadedAtLastDidLoadingProgress(invalidTime())
     , m_seekTo(invalidTime())
     , m_requestedRate(1)
     , m_delayCallbacks(0)
@@ -367,15 +366,14 @@
     return m_cachedMaxTimeLoaded;   
 }
 
-bool MediaPlayerPrivateAVFoundation::didLoadingProgress() const
+unsigned MediaPlayerPrivateAVFoundation::bytesLoaded() const
 {
-    if (!duration() || !totalBytes())
-        return false;
-    float currentMaxTimeLoaded = maxTimeLoaded();
-    bool didLoadingProgress = currentMaxTimeLoaded != m_maxTimeLoadedAtLastDidLoadingProgress;
-    m_maxTimeLoadedAtLastDidLoadingProgress = currentMaxTimeLoaded;
-    LOG(Media, "MediaPlayerPrivateAVFoundation::didLoadingProgress(%p) - returning %d", this, didLoadingProgress);
-    return didLoadingProgress;
+    float dur = duration();
+    if (!dur)
+        return 0;
+    unsigned loaded = totalBytes() * maxTimeLoaded() / dur;
+    LOG(Media, "MediaPlayerPrivateAVFoundation::bytesLoaded(%p) - returning %i", this, loaded);
+    return loaded;
 }
 
 bool MediaPlayerPrivateAVFoundation::isReadyForVideoSetup() const

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h (119145 => 119146)


--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h	2012-05-31 21:03:16 UTC (rev 119145)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h	2012-05-31 21:09:01 UTC (rev 119146)
@@ -140,7 +140,7 @@
     virtual MediaPlayer::ReadyState readyState() const { return m_readyState; }
     virtual float maxTimeSeekable() const;
     virtual PassRefPtr<TimeRanges> buffered() const;
-    virtual bool didLoadingProgress() const;
+    virtual unsigned bytesLoaded() const;
     virtual void setSize(const IntSize&);
     virtual void paint(GraphicsContext*, const IntRect&) = 0;
     virtual void paintCurrentFrameInContext(GraphicsContext*, const IntRect&) = 0;
@@ -263,7 +263,7 @@
     mutable float m_cachedMaxTimeSeekable;
     mutable float m_cachedDuration;
     float m_reportedDuration;
-    mutable float m_maxTimeLoadedAtLastDidLoadingProgress;
+
     float m_seekTo;
     float m_requestedRate;
     mutable int m_delayCallbacks;

Modified: trunk/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp (119145 => 119146)


--- trunk/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp	2012-05-31 21:03:16 UTC (rev 119145)
+++ trunk/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp	2012-05-31 21:09:01 UTC (rev 119146)
@@ -288,10 +288,10 @@
     return timeRanges.release();
 }
 
-bool MediaPlayerPrivate::didLoadingProgress() const
+unsigned MediaPlayerPrivate::bytesLoaded() const
 {
     notImplemented();
-    return false;
+    return 0;
 }
 
 void MediaPlayerPrivate::setSize(const IntSize&)

Modified: trunk/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h (119145 => 119146)


--- trunk/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h	2012-05-31 21:03:16 UTC (rev 119145)
+++ trunk/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h	2012-05-31 21:09:01 UTC (rev 119146)
@@ -83,7 +83,7 @@
     virtual float maxTimeSeekable() const;
     virtual PassRefPtr<TimeRanges> buffered() const;
 
-    virtual bool didLoadingProgress() const;
+    virtual unsigned bytesLoaded() const;
 
     virtual void setSize(const IntSize&);
 

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (119145 => 119146)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2012-05-31 21:03:16 UTC (rev 119145)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2012-05-31 21:09:01 UTC (rev 119146)
@@ -227,7 +227,6 @@
     , m_preload(MediaPlayer::Auto)
     , m_delayingLoad(false)
     , m_mediaDurationKnown(true)
-    , m_maxTimeLoadedAtLastDidLoadingProgress(0)
     , m_volumeTimerHandler(0)
     , m_muteTimerHandler(0)
     , m_hasVideo(false)
@@ -921,15 +920,17 @@
     return loaded;
 }
 
-bool MediaPlayerPrivateGStreamer::didLoadingProgress() const
+unsigned MediaPlayerPrivateGStreamer::bytesLoaded() const
 {
-    if (!m_playBin || !m_mediaDuration || !totalBytes())
-        return false;
-    float currentMaxTimeLoaded = maxTimeLoaded();
-    bool didLoadingProgress = currentMaxTimeLoaded != m_maxTimeLoadedAtLastDidLoadingProgress;
-    m_maxTimeLoadedAtLastDidLoadingProgress = currentMaxTimeLoaded;
-    LOG_VERBOSE(Media, "didLoadingProgress: %d", didLoadingProgress);
-    return didLoadingProgress;
+    if (!m_playBin)
+        return 0;
+
+    if (!m_mediaDuration)
+        return 0;
+
+    unsigned loaded = totalBytes() * maxTimeLoaded() / m_mediaDuration;
+    LOG_VERBOSE(Media, "bytesLoaded: %d", loaded);
+    return loaded;
 }
 
 unsigned MediaPlayerPrivateGStreamer::totalBytes() const

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h (119145 => 119146)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h	2012-05-31 21:03:16 UTC (rev 119145)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h	2012-05-31 21:09:01 UTC (rev 119146)
@@ -90,7 +90,7 @@
 
             PassRefPtr<TimeRanges> buffered() const;
             float maxTimeSeekable() const;
-            bool didLoadingProgress() const;
+            unsigned bytesLoaded() const;
             unsigned totalBytes() const;
 
             void setVisible(bool);
@@ -181,7 +181,6 @@
             MediaPlayer::Preload m_preload;
             bool m_delayingLoad;
             bool m_mediaDurationKnown;
-            mutable float m_maxTimeLoadedAtLastDidLoadingProgress;
 #ifndef GST_API_VERSION_1
             RefPtr<GStreamerGWorld> m_gstGWorld;
 #endif

Modified: trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h (119145 => 119146)


--- trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h	2012-05-31 21:03:16 UTC (rev 119145)
+++ trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h	2012-05-31 21:09:01 UTC (rev 119146)
@@ -121,7 +121,7 @@
     
     PassRefPtr<TimeRanges> buffered() const;
     float maxTimeSeekable() const;
-    bool didLoadingProgress() const;
+    unsigned bytesLoaded() const;
     unsigned totalBytes() const;
     
     void setVisible(bool);
@@ -212,7 +212,6 @@
     bool m_videoFrameHasDrawn;
     bool m_isAllowedToRender;
     bool m_privateBrowsing;
-    mutable float m_maxTimeLoadedAtLastDidLoadingProgress;
 #if DRAW_FRAME_RATE
     int  m_frameCountWhilePlaying;
     double m_timeStartedPlaying;

Modified: trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm (119145 => 119146)


--- trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm	2012-05-31 21:03:16 UTC (rev 119145)
+++ trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm	2012-05-31 21:09:01 UTC (rev 119146)
@@ -214,7 +214,6 @@
     , m_videoFrameHasDrawn(false)
     , m_isAllowedToRender(false)
     , m_privateBrowsing(false)
-    , m_maxTimeLoadedAtLastDidLoadingProgress(0)
 #if DRAW_FRAME_RATE
     , m_frameCountWhilePlaying(0)
     , m_timeStartedPlaying(0)
@@ -946,14 +945,12 @@
     return wkQTMovieMaxTimeLoaded(m_qtMovie.get()); 
 }
 
-bool MediaPlayerPrivateQTKit::didLoadingProgress() const
+unsigned MediaPlayerPrivateQTKit::bytesLoaded() const
 {
-    if (!duration() || !totalBytes())
-        return false;
-    float currentMaxTimeLoaded = maxTimeLoaded();
-    bool didLoadingProgress = currentMaxTimeLoaded != m_maxTimeLoadedAtLastDidLoadingProgress;
-    m_maxTimeLoadedAtLastDidLoadingProgress = currentMaxTimeLoaded;
-    return didLoadingProgress;
+    float dur = duration();
+    if (!dur)
+        return 0;
+    return totalBytes() * maxTimeLoaded() / dur;
 }
 
 unsigned MediaPlayerPrivateQTKit::totalBytes() const

Modified: trunk/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp (119145 => 119146)


--- trunk/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp	2012-05-31 21:03:16 UTC (rev 119145)
+++ trunk/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp	2012-05-31 21:09:01 UTC (rev 119146)
@@ -116,7 +116,6 @@
     , m_isSeeking(false)
     , m_composited(false)
     , m_preload(MediaPlayer::Auto)
-    , m_bytesLoadedAtLastDidLoadingProgress(0)
     , m_suppressNextPlaybackChanged(false)
 {
     m_mediaPlayer->setVideoOutput(m_videoItem);
@@ -362,17 +361,13 @@
     return static_cast<float>(m_mediaPlayerControl->availablePlaybackRanges().latestTime()) / 1000.0f;
 }
 
-bool MediaPlayerPrivateQt::didLoadingProgress() const
+unsigned MediaPlayerPrivateQt::bytesLoaded() const
 {
-    unsigned bytesLoaded = 0;
     QLatin1String bytesLoadedKey("bytes-loaded");
     if (m_mediaPlayer->availableExtendedMetaData().contains(bytesLoadedKey))
-        bytesLoaded = m_mediaPlayer->extendedMetaData(bytesLoadedKey).toInt();
-    else
-        bytesLoaded = m_mediaPlayer->bufferStatus();
-    bool didLoadingProgress = bytesLoaded != m_bytesLoadedAtLastDidLoadingProgress;
-    m_bytesLoadedAtLastDidLoadingProgress = bytesLoaded;
-    return didLoadingProgress;
+        return m_mediaPlayer->extendedMetaData(bytesLoadedKey).toInt();
+
+    return m_mediaPlayer->bufferStatus();
 }
 
 unsigned MediaPlayerPrivateQt::totalBytes() const

Modified: trunk/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h (119145 => 119146)


--- trunk/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h	2012-05-31 21:03:16 UTC (rev 119145)
+++ trunk/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h	2012-05-31 21:09:01 UTC (rev 119146)
@@ -86,7 +86,7 @@
 
     PassRefPtr<TimeRanges> buffered() const;
     float maxTimeSeekable() const;
-    bool didLoadingProgress() const;
+    unsigned bytesLoaded() const;
     unsigned totalBytes() const;
 
     void setVisible(bool);
@@ -156,7 +156,6 @@
     bool m_isSeeking;
     bool m_composited;
     MediaPlayer::Preload m_preload;
-    mutable unsigned m_bytesLoadedAtLastDidLoadingProgress;
     bool m_delayingLoad;
     String m_mediaUrl;
     bool m_suppressNextPlaybackChanged;

Modified: trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp (119145 => 119146)


--- trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp	2012-05-31 21:03:16 UTC (rev 119145)
+++ trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp	2012-05-31 21:09:01 UTC (rev 119146)
@@ -183,7 +183,6 @@
     , m_delayingLoad(false)
     , m_privateBrowsing(false)
     , m_preload(MediaPlayer::Auto)
-    , m_maxTimeLoadedAtLastDidLoadingProgress(0)
 {
 }
 
@@ -584,14 +583,15 @@
     return m_movie->maxTimeLoaded(); 
 }
 
-bool MediaPlayerPrivateQuickTimeVisualContext::didLoadingProgress() const
+unsigned MediaPlayerPrivateQuickTimeVisualContext::bytesLoaded() const
 {
-    if (!m_movie || !duration())
-        return false;
-    float currentMaxTimeLoaded = maxTimeLoaded();
-    bool didLoadingProgress = currentMaxTimeLoaded != m_maxTimeLoadedAtLastDidLoadingProgress;
-    m_maxTimeLoadedAtLastDidLoadingProgress = currentMaxTimeLoaded;
-    return didLoadingProgress;
+    if (!m_movie)
+        return 0;
+    float dur = duration();
+    float maxTime = maxTimeLoaded();
+    if (!dur)
+        return 0;
+    return totalBytes() * maxTime / dur;
 }
 
 unsigned MediaPlayerPrivateQuickTimeVisualContext::totalBytes() const

Modified: trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h (119145 => 119146)


--- trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h	2012-05-31 21:03:16 UTC (rev 119145)
+++ trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h	2012-05-31 21:09:01 UTC (rev 119146)
@@ -99,7 +99,7 @@
     
     PassRefPtr<TimeRanges> buffered() const;
     float maxTimeSeekable() const;
-    bool didLoadingProgress() const;
+    unsigned bytesLoaded() const;
     unsigned totalBytes() const;
     
     void setVisible(bool);
@@ -201,7 +201,6 @@
     String m_movieURL;
     bool m_privateBrowsing;
     MediaPlayer::Preload m_preload;
-    mutable float m_maxTimeLoadedAtLastDidLoadingProgress;
 #if DRAW_FRAME_RATE
     double m_frameCountWhilePlaying;
     double m_timeStartedPlaying;

Modified: trunk/Source/WebCore/platform/graphics/wince/MediaPlayerPrivateWinCE.h (119145 => 119146)


--- trunk/Source/WebCore/platform/graphics/wince/MediaPlayerPrivateWinCE.h	2012-05-31 21:03:16 UTC (rev 119145)
+++ trunk/Source/WebCore/platform/graphics/wince/MediaPlayerPrivateWinCE.h	2012-05-31 21:09:01 UTC (rev 119146)
@@ -70,7 +70,6 @@
 
         PassRefPtr<TimeRanges> buffered() const;
         float maxTimeSeekable() const;
-        // FIXME: bytesLoaded() should be replaced with didLoadingProgress() (by somebody who can find the implementation of this class).
         unsigned bytesLoaded() const;
         unsigned totalBytes() const;
 

Modified: trunk/Source/WebKit/chromium/ChangeLog (119145 => 119146)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-05-31 21:03:16 UTC (rev 119145)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-05-31 21:09:01 UTC (rev 119146)
@@ -1,3 +1,19 @@
+2012-05-31  Sheriff Bot  <webkit.review....@gmail.com>
+
+        Unreviewed, rolling out r119125.
+        http://trac.webkit.org/changeset/119125
+        https://bugs.webkit.org/show_bug.cgi?id=88007
+
+        Will break android build if rolled (Requested by rafaelw_ on
+        #webkit).
+
+        * public/WebMediaPlayer.h:
+        (WebMediaPlayer):
+        * src/WebMediaPlayerClientImpl.cpp:
+        (WebKit::WebMediaPlayerClientImpl::bytesLoaded):
+        * src/WebMediaPlayerClientImpl.h:
+        (WebMediaPlayerClientImpl):
+
 2012-05-31  Dana Jansens  <dan...@chromium.org>
 
         [chromium] Move drawing code for RenderSurfaces into LayerRendererChromium

Modified: trunk/Source/WebKit/chromium/public/WebMediaPlayer.h (119145 => 119146)


--- trunk/Source/WebKit/chromium/public/WebMediaPlayer.h	2012-05-31 21:03:16 UTC (rev 119145)
+++ trunk/Source/WebKit/chromium/public/WebMediaPlayer.h	2012-05-31 21:09:01 UTC (rev 119146)
@@ -144,7 +144,7 @@
     virtual NetworkState networkState() const = 0;
     virtual ReadyState readyState() const = 0;
 
-    virtual bool didLoadingProgress() const = 0;
+    virtual unsigned long long bytesLoaded() const = 0;
     virtual unsigned long long totalBytes() const = 0;
 
     virtual bool hasSingleSecurityOrigin() const = 0;

Modified: trunk/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp (119145 => 119146)


--- trunk/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp	2012-05-31 21:03:16 UTC (rev 119145)
+++ trunk/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp	2012-05-31 21:09:01 UTC (rev 119146)
@@ -593,9 +593,11 @@
     return 0;
 }
 
-bool WebMediaPlayerClientImpl::didLoadingProgress() const
+unsigned WebMediaPlayerClientImpl::bytesLoaded() const
 {
-    return m_webMediaPlayer && m_webMediaPlayer->didLoadingProgress();
+    if (m_webMediaPlayer)
+        return static_cast<unsigned>(m_webMediaPlayer->bytesLoaded());
+    return 0;
 }
 
 void WebMediaPlayerClientImpl::setSize(const IntSize& size)

Modified: trunk/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h (119145 => 119146)


--- trunk/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h	2012-05-31 21:03:16 UTC (rev 119145)
+++ trunk/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h	2012-05-31 21:09:01 UTC (rev 119146)
@@ -122,7 +122,7 @@
     virtual int dataRate() const;
     virtual bool totalBytesKnown() const;
     virtual unsigned totalBytes() const;
-    virtual bool didLoadingProgress() const;
+    virtual unsigned bytesLoaded() const;
     virtual void setSize(const WebCore::IntSize&);
     virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect&);
     virtual void paintCurrentFrameInContext(WebCore::GraphicsContext*, const WebCore::IntRect&);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to