diff options
author | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-16 16:57:02 +0000 |
---|---|---|
committer | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-16 16:57:02 +0000 |
commit | a9590c25660d4be4caad2add5e16e08003e5ed39 (patch) | |
tree | 10b2dd0b18e9122aa0eb86d80e14c8e3efafd73e /webkit/glue/webmediaplayer_impl.h | |
parent | bac2d4979f97026ed1344cd2dc9b208f58886537 (diff) | |
download | chromium_src-a9590c25660d4be4caad2add5e16e08003e5ed39.zip chromium_src-a9590c25660d4be4caad2add5e16e08003e5ed39.tar.gz chromium_src-a9590c25660d4be4caad2add5e16e08003e5ed39.tar.bz2 |
PipelineError is dead. Long live PipelineStatus!
PipelineError was a poor naming choice because most of the time variables of
that type held the value PIPELINE_OK meaning there was in fact no error.
Replaced the idiom of [0-ary callback + GetError()] with
[1-ary callback taking PipelineStatus argument] which makes the Pipeline API
cleaner and less error-prone. Before, consumers of the API had to make sure to
call GetError() at the top of each callback, or risk missing state transitions
in the pipeline. Now each callback gets an explicit parameter holding the
pipeline status at the moment the callback was invoked so failing to handle
error conditions should be more apparent in the code.
BUG=none
TEST=media_unittests + trybots: {mac,linux,win}{_layout,}, linux_rel, linux_clang (all pass or fail with unrelated errors)
Review URL: http://codereview.chromium.org/6686061
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78379 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webmediaplayer_impl.h')
-rw-r--r-- | webkit/glue/webmediaplayer_impl.h | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/webkit/glue/webmediaplayer_impl.h b/webkit/glue/webmediaplayer_impl.h index e7acf27..ef356b5 100644 --- a/webkit/glue/webmediaplayer_impl.h +++ b/webkit/glue/webmediaplayer_impl.h @@ -111,11 +111,11 @@ class WebMediaPlayerImpl : public WebKit::WebMediaPlayer, void AbortDataSources(); // Methods for PipelineImpl -> WebMediaPlayerImpl communication. - void PipelineInitializationCallback(); - void PipelineSeekCallback(); - void PipelineEndedCallback(); - void PipelineErrorCallback(); - void NetworkEventCallback(); + void PipelineInitializationCallback(media::PipelineStatus status); + void PipelineSeekCallback(media::PipelineStatus status); + void PipelineEndedCallback(media::PipelineStatus status); + void PipelineErrorCallback(media::PipelineStatus error); + void NetworkEventCallback(media::PipelineStatus status); // Returns the message loop used by the proxy. MessageLoop* message_loop() { return render_loop_; } @@ -132,19 +132,20 @@ class WebMediaPlayerImpl : public WebKit::WebMediaPlayer, void RepaintTask(); // Notify |webmediaplayer_| that initialization has finished. - void PipelineInitializationTask(); + void PipelineInitializationTask(media::PipelineStatus status); // Notify |webmediaplayer_| that a seek has finished. - void PipelineSeekTask(); + void PipelineSeekTask(media::PipelineStatus status); // Notify |webmediaplayer_| that the media has ended. - void PipelineEndedTask(); + void PipelineEndedTask(media::PipelineStatus status); - // Notify |webmediaplayer_| that a pipeline error has been set. - void PipelineErrorTask(); + // Notify |webmediaplayer_| that a pipeline error has occurred during + // playback. + void PipelineErrorTask(media::PipelineStatus error); // Notify |webmediaplayer_| that there's a network event. - void NetworkEventTask(); + void NetworkEventTask(media::PipelineStatus status); // The render message loop where WebKit lives. MessageLoop* render_loop_; @@ -261,15 +262,15 @@ class WebMediaPlayerImpl : public WebKit::WebMediaPlayer, void Repaint(); - void OnPipelineInitialize(); + void OnPipelineInitialize(media::PipelineStatus status); - void OnPipelineSeek(); + void OnPipelineSeek(media::PipelineStatus status); - void OnPipelineEnded(); + void OnPipelineEnded(media::PipelineStatus status); - void OnPipelineError(); + void OnPipelineError(media::PipelineStatus error); - void OnNetworkEvent(); + void OnNetworkEvent(media::PipelineStatus status); private: // Helpers that set the network/ready state and notifies the client if @@ -282,7 +283,7 @@ class WebMediaPlayerImpl : public WebKit::WebMediaPlayer, // Callback executed after |pipeline_| stops which signals Destroy() // to continue. - void PipelineStoppedCallback(); + void PipelineStoppedCallback(media::PipelineStatus status); // Getter method to |client_|. WebKit::WebMediaPlayerClient* GetClient(); |