summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-22 22:27:51 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-22 22:27:51 +0000
commita28e65042b2dfb6c682170f8bb41de12210694d5 (patch)
tree200b97a948bfad2ac2a3e214c78d360b24e6267e
parentf1945d4d2e84643e21f76309c1a7590ee9dc7162 (diff)
downloadchromium_src-a28e65042b2dfb6c682170f8bb41de12210694d5.zip
chromium_src-a28e65042b2dfb6c682170f8bb41de12210694d5.tar.gz
chromium_src-a28e65042b2dfb6c682170f8bb41de12210694d5.tar.bz2
Removing FilterHost::PostTask() in preparation of injected message loops.
TEST=none BUG=none Review URL: http://codereview.chromium.org/145001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18972 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--media/base/filter_host.h8
-rw-r--r--media/base/filter_host_impl.cc8
-rw-r--r--media/base/filter_host_impl.h4
-rw-r--r--media/base/mock_filter_host.h4
-rw-r--r--media/base/mock_media_filters.h27
5 files changed, 2 insertions, 49 deletions
diff --git a/media/base/filter_host.h b/media/base/filter_host.h
index 28e56d1..b911473 100644
--- a/media/base/filter_host.h
+++ b/media/base/filter_host.h
@@ -13,11 +13,6 @@
// data to the audio hardware. A video renderer filter typically calls GetTime
// to synchronize video with audio. An audio and video decoder would typically
// have no need to call either SetTime or GetTime.
-//
-// The reasoning behind providing PostTask is to discourage filters from
-// implementing their own threading. The overall design is that many filters
-// can share few threads and that notifications return quickly by scheduling
-// processing with PostTask.
#ifndef MEDIA_BASE_FILTER_HOST_H_
#define MEDIA_BASE_FILTER_HOST_H_
@@ -59,9 +54,6 @@ class FilterHost {
// choose call it after processing some data.
virtual void InitializationComplete() = 0;
- // Posts a task to be executed asynchronously on the pipeline's thread.
- virtual void PostTask(Task* task) = 0;
-
// Stops execution of the pipeline due to a fatal error. Do not call this
// method with PIPELINE_OK or PIPELINE_STOPPING (used internally by pipeline).
virtual void Error(PipelineError error) = 0;
diff --git a/media/base/filter_host_impl.cc b/media/base/filter_host_impl.cc
index 6cf39cd..0cd348a 100644
--- a/media/base/filter_host_impl.cc
+++ b/media/base/filter_host_impl.cc
@@ -60,14 +60,6 @@ void FilterHostImpl::InitializationComplete() {
pipeline_thread_->InitializationComplete(this);
}
-void FilterHostImpl::PostTask(Task* task) {
- if (stopped_) {
- delete task;
- } else {
- pipeline_thread_->PostTask(task);
- }
-}
-
void FilterHostImpl::Error(PipelineError error) {
pipeline_thread_->Error(error);
}
diff --git a/media/base/filter_host_impl.h b/media/base/filter_host_impl.h
index af1c9e3..4ae9260 100644
--- a/media/base/filter_host_impl.h
+++ b/media/base/filter_host_impl.h
@@ -20,7 +20,6 @@ class FilterHostImpl : public FilterHost {
virtual void SetTimeUpdateCallback(Callback1<base::TimeDelta>::Type* cb);
virtual void ScheduleTimeUpdateCallback(base::TimeDelta time);
virtual void InitializationComplete();
- virtual void PostTask(Task* task);
virtual void Error(PipelineError error);
virtual void SetTime(base::TimeDelta time);
virtual void SetDuration(base::TimeDelta duration);
@@ -130,8 +129,7 @@ class FilterHostImpl : public FilterHost {
// Pointer to the current time update callback task.
TimeUpdateTask* scheduled_time_update_task_;
- // Used to avoid calling Filter's Stop method multiplie times. It is also
- // used to prevent a filter that has been stopped from calling PostTask.
+ // Used to avoid calling Filter's Stop() method multiple times.
bool stopped_;
DISALLOW_COPY_AND_ASSIGN(FilterHostImpl);
diff --git a/media/base/mock_filter_host.h b/media/base/mock_filter_host.h
index 8bef47e..0c1ae43 100644
--- a/media/base/mock_filter_host.h
+++ b/media/base/mock_filter_host.h
@@ -58,10 +58,6 @@ class MockFilterHost : public FilterHost {
wait_for_initialized_.Signal();
}
- virtual void PostTask(Task* task) {
- mock_pipeline_->PostTask(task);
- }
-
virtual void Error(PipelineError error) {
error_ = error;
mock_pipeline_->Error(error);
diff --git a/media/base/mock_media_filters.h b/media/base/mock_media_filters.h
index b8a8f74..b8749d9 100644
--- a/media/base/mock_media_filters.h
+++ b/media/base/mock_media_filters.h
@@ -31,11 +31,8 @@ namespace old_mocks {
enum MockDataSourceBehavior {
MOCK_DATA_SOURCE_NORMAL_INIT,
MOCK_DATA_SOURCE_NEVER_INIT,
- MOCK_DATA_SOURCE_TASK_INIT,
MOCK_DATA_SOURCE_URL_ERROR_IN_INIT,
MOCK_DATA_SOURCE_INIT_RETURN_FALSE,
- MOCK_DATA_SOURCE_TASK_ERROR_PRE_INIT,
- MOCK_DATA_SOURCE_TASK_ERROR_POST_INIT
};
@@ -115,13 +112,6 @@ class MockDataSource : public DataSource {
return true;
case MOCK_DATA_SOURCE_NEVER_INIT:
return true;
- case MOCK_DATA_SOURCE_TASK_ERROR_POST_INIT:
- host_->InitializationComplete();
- // Yes, we want to fall through to schedule the task...
- case MOCK_DATA_SOURCE_TASK_ERROR_PRE_INIT:
- case MOCK_DATA_SOURCE_TASK_INIT:
- host_->PostTask(NewRunnableMethod(this, &MockDataSource::TaskBehavior));
- return true;
case MOCK_DATA_SOURCE_URL_ERROR_IN_INIT:
host_->Error(PIPELINE_ERROR_URL_NOT_FOUND);
return false;
@@ -182,20 +172,6 @@ class MockDataSource : public DataSource {
}
}
- void TaskBehavior() {
- switch (config_->data_source_behavior) {
- case MOCK_DATA_SOURCE_TASK_ERROR_POST_INIT:
- case MOCK_DATA_SOURCE_TASK_ERROR_PRE_INIT:
- host_->Error(PIPELINE_ERROR_NETWORK);
- break;
- case MOCK_DATA_SOURCE_TASK_INIT:
- host_->InitializationComplete();
- break;
- default:
- NOTREACHED();
- }
- }
-
const MockFilterConfig* config_;
int64 position_;
MediaFormat media_format_;
@@ -437,8 +413,7 @@ class MockVideoDecoder : public VideoDecoder {
}
virtual void Read(Callback1<VideoFrame*>::Type* callback) {
- host_->PostTask(NewRunnableMethod(
- this, &MockVideoDecoder::DoRead, callback));
+ DoRead(callback);
}
// Mock accessors.