Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(516)

Unified Diff: media/base/filters.cc

Issue 6969026: Convert Filter::Seek() to use new callback system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add files in content/renderer/media Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/base/filters.cc
diff --git a/media/base/filters.cc b/media/base/filters.cc
index 8b2e24a778dbb1b4452202c8b9e349da261087d0..c21d12dc8feeea45f9498b72e245f1dc1ff3f7e9 100644
--- a/media/base/filters.cc
+++ b/media/base/filters.cc
@@ -8,6 +8,11 @@
namespace media {
+FilterStatusCB CopyAndResetCB(FilterStatusCB& cb) {
+ FilterStatusCB ret(cb);
+ cb.Reset();
+ return ret;
+}
Filter::Filter() : host_(NULL) {}
Filter::~Filter() {}
@@ -56,11 +61,10 @@ void Filter::Stop(FilterCallback* callback) {
void Filter::SetPlaybackRate(float playback_rate) {}
-void Filter::Seek(base::TimeDelta time, FilterCallback* callback) {
- scoped_ptr<FilterCallback> seek_callback(callback);
- if (seek_callback.get()) {
- seek_callback->Run();
- }
+void Filter::Seek(base::TimeDelta time, const FilterStatusCB& callback) {
+ DCHECK(!callback.is_null());
+ if (!callback.is_null())
Ami GONE FROM CHROMIUM 2011/05/12 20:42:16 I don't understand the DCHECK+if. Is there a missi
acolwell GONE FROM CHROMIUM 2011/05/12 22:30:40 I was just making it match the other methods. I'll
+ callback.Run(PIPELINE_OK);
Ami GONE FROM CHROMIUM 2011/05/12 20:42:16 outdent
acolwell GONE FROM CHROMIUM 2011/05/12 22:30:40 Done.
}
void Filter::OnAudioRendererDisabled() {

Powered by Google App Engine
This is Rietveld 408576698