summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-27 22:41:55 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-27 22:41:55 +0000
commit698835d3e64c96bb5e7a29ab66d2ecbee375fc63 (patch)
tree4e06c91dbf1c245fb3f0b4d80c327463e7951fe0 /media
parentec9767f8c6889b40494ec8aab55f0cd913f97746 (diff)
downloadchromium_src-698835d3e64c96bb5e7a29ab66d2ecbee375fc63.zip
chromium_src-698835d3e64c96bb5e7a29ab66d2ecbee375fc63.tar.gz
chromium_src-698835d3e64c96bb5e7a29ab66d2ecbee375fc63.tar.bz2
Fixed a lot threading issues during tear down of <video>
Fixed a lot of dead locks during tead down of <video> due to DataSourceImpl. Most of the issues come from that during a tab close RenderThread is destroyed and new tasks posted on it will not executed, but DataSourceImpl is waiting for those tasks to finish to complete stopping. Another dead lock comes from that when RenderThread is destroyed the owner loop of it (a IO Message Loop) is being destroyed too and DataSourceImpl shouldn't post tasks to that message loop when stopping. Review URL: http://codereview.chromium.org/42675 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12720 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r--media/base/filter_host_impl.cc1
-rw-r--r--media/base/pipeline_impl.cc8
2 files changed, 4 insertions, 5 deletions
diff --git a/media/base/filter_host_impl.cc b/media/base/filter_host_impl.cc
index 74eaa16..cba2eb1 100644
--- a/media/base/filter_host_impl.cc
+++ b/media/base/filter_host_impl.cc
@@ -61,7 +61,6 @@ void FilterHostImpl::InitializationComplete() {
}
void FilterHostImpl::PostTask(Task* task) {
- DCHECK(!stopped_);
if (stopped_) {
delete task;
} else {
diff --git a/media/base/pipeline_impl.cc b/media/base/pipeline_impl.cc
index a36da6c..5bc3faa 100644
--- a/media/base/pipeline_impl.cc
+++ b/media/base/pipeline_impl.cc
@@ -401,10 +401,10 @@ void PipelineThread::StopTask() {
if (PipelineOk()) {
pipeline_->error_ = PIPELINE_STOPPING;
}
- FilterHostVector::reverse_iterator riter = filter_hosts_.rbegin();
- while (riter != filter_hosts_.rend()) {
- (*riter)->Stop();
- ++riter;
+ FilterHostVector::iterator iter = filter_hosts_.begin();
+ while (iter != filter_hosts_.end()) {
+ (*iter)->Stop();
+ ++iter;
}
if (host_initializing_) {
host_initializing_ = NULL;