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 /media/base/pipeline_status.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 'media/base/pipeline_status.h')
-rw-r--r-- | media/base/pipeline_status.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/media/base/pipeline_status.h b/media/base/pipeline_status.h index 787708e..84c8d4f 100644 --- a/media/base/pipeline_status.h +++ b/media/base/pipeline_status.h @@ -9,9 +9,8 @@ namespace media { -// Error definitions for pipeline. All codes indicate an error except: -// PIPELINE_OK indicates the pipeline is running normally. -enum PipelineError { +// Status states for pipeline. All codes except PIPELINE_OK indicate errors. +enum PipelineStatus { PIPELINE_OK, PIPELINE_ERROR_URL_NOT_FOUND, PIPELINE_ERROR_NETWORK, @@ -34,7 +33,7 @@ enum PipelineError { DATASOURCE_ERROR_URL_NOT_SUPPORTED, }; -typedef Callback1<media::PipelineError>::Type PipelineStatusCallback; +typedef Callback1<media::PipelineStatus>::Type PipelineStatusCallback; } // namespace media |