summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webmediaplayer_impl.h
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-23 00:56:24 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-23 00:56:24 +0000
commitf467d03becdffdd9862dacb1feec243781f24952 (patch)
tree8982da1095ecdcf92a4c8ada323b208d32211f0b /webkit/glue/webmediaplayer_impl.h
parent645e51066961549cb2bf9ff00d141d2a46a9bb7d (diff)
downloadchromium_src-f467d03becdffdd9862dacb1feec243781f24952.zip
chromium_src-f467d03becdffdd9862dacb1feec243781f24952.tar.gz
chromium_src-f467d03becdffdd9862dacb1feec243781f24952.tar.bz2
Use a saved copy of the time when pausing media elements.
Since our internal pause is asynchronous and we don't want to hang the render thread, it's possible to have our clock creep ahead. This produces unexpected behaviour when pausing media elements, such as seeing currentTime attribute nudge a little ahead after calling pause(). This so happens to also address layout test flakiness. BUG=13907 TEST=layout tests, especially video-pause-immediately.html -- a new layout test I wrote and am upstreaming Review URL: http://codereview.chromium.org/334002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29851 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webmediaplayer_impl.h')
-rw-r--r--webkit/glue/webmediaplayer_impl.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/webkit/glue/webmediaplayer_impl.h b/webkit/glue/webmediaplayer_impl.h
index 5c5de44..97c4d89 100644
--- a/webkit/glue/webmediaplayer_impl.h
+++ b/webkit/glue/webmediaplayer_impl.h
@@ -271,8 +271,15 @@ class WebMediaPlayerImpl : public WebKit::WebMediaPlayer,
// single "playback rate" over worrying about paused/stopped etc... It forces
// all clients to manage the pause+playback rate externally, but is that
// really a bad thing?
+ //
+ // TODO(scherkus): since SetPlaybackRate(0) is asynchronous and we don't want
+ // to hang the render thread during pause(), we record the time at the same
+ // time we pause and then return that value in currentTime(). Otherwise our
+ // clock can creep forward a little bit while the asynchronous
+ // SetPlaybackRate(0) is being executed.
bool paused_;
float playback_rate_;
+ base::TimeDelta paused_time_;
WebKit::WebMediaPlayerClient* client_;