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

Unified Diff: media/base/pipeline_impl.cc

Issue 160298: Pipeline will execute a callback whenever an run-time error has happened. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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
« no previous file with comments | « media/base/pipeline_impl.h ('k') | media/base/pipeline_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/pipeline_impl.cc
===================================================================
--- media/base/pipeline_impl.cc (revision 22059)
+++ media/base/pipeline_impl.cc (working copy)
@@ -247,6 +247,10 @@
return error_;
}
+void PipelineImpl::SetPipelineErrorCallback(PipelineCallback* error_callback) {
+ error_callback_.reset(error_callback);
+}
+
void PipelineImpl::ResetState() {
AutoLock auto_lock(lock_);
const base::TimeDelta kZero;
@@ -551,6 +555,12 @@
// Destroy every filter and reset the pipeline as well.
DestroyFilters();
+
+ // If our owner has requested to be notified of an error, execute
+ // |error_callback_| unless we have a "good" error.
+ if (error_callback_.get() && error != PIPELINE_STOPPING) {
+ error_callback_->Run();
+ }
}
void PipelineImpl::PlaybackRateChangedTask(float playback_rate) {
« no previous file with comments | « media/base/pipeline_impl.h ('k') | media/base/pipeline_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698