diff options
author | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-11 17:40:15 +0000 |
---|---|---|
committer | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-11 17:40:15 +0000 |
commit | 5badb08f6f862645e950d97c7a58995724cd0c42 (patch) | |
tree | 415b0860139754f61db04cde1f4dba9501fd47be /media/base | |
parent | 21ab5b9c9c64061b15d79a29b5ea337e4acc8953 (diff) | |
download | chromium_src-5badb08f6f862645e950d97c7a58995724cd0c42.zip chromium_src-5badb08f6f862645e950d97c7a58995724cd0c42.tar.gz chromium_src-5badb08f6f862645e950d97c7a58995724cd0c42.tar.bz2 |
Make MediaFilter::Stop() asynchronous.
This is the second issue regarding making Stop() asynchronous.
All Stop() in subclasses of MediaFilter is made to accept a callback and
runs the callback at the end of its stop.
BUG=16059
TEST=media_unittest, unit_tests, test_shell_tests still passes
Review URL: http://codereview.chromium.org/2541003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49548 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base')
-rw-r--r-- | media/base/filters.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/media/base/filters.h b/media/base/filters.h index 141a753..80a3bd2 100644 --- a/media/base/filters.h +++ b/media/base/filters.h @@ -91,7 +91,9 @@ class MediaFilter : public base::RefCountedThreadSafe<MediaFilter> { // The pipeline has resumed playback. Filters can continue requesting reads. // Filters may implement this method if they need to respond to this call. + // TODO(boliu): Check that callback is not NULL in sublcasses. virtual void Play(FilterCallback* callback) { + DCHECK(callback); if (callback) { callback->Run(); delete callback; @@ -101,24 +103,20 @@ class MediaFilter : public base::RefCountedThreadSafe<MediaFilter> { // The pipeline has paused playback. Filters should fulfill any existing read // requests and then idle. Filters may implement this method if they need to // respond to this call. + // TODO(boliu): Check that callback is not NULL in sublcasses. virtual void Pause(FilterCallback* callback) { + DCHECK(callback); if (callback) { callback->Run(); delete callback; } } - // TODO(boliu): Remove once Stop() is asynchronous in subclasses. - virtual void Stop() {} - // The pipeline is being stopped either as a result of an error or because // the client called Stop(). - // TODO(boliu): No implementation in subclasses yet. + // TODO(boliu): Check that callback is not NULL in sublcasses. virtual void Stop(FilterCallback* callback) { - // TODO(boliu): Call the synchronous version for now. Remove once - // all filters have asynchronous stop. - Stop(); - + DCHECK(callback); if (callback) { callback->Run(); delete callback; |