diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 23:20:04 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 23:20:04 +0000 |
commit | 859bcc91dc0cca4984fceecfe406c6042d209fe6 (patch) | |
tree | dbed85e562a24cdb57dda9c8676ed22ffacba760 /media/base | |
parent | c1bf07dd1da400c45c8b0af7aa3f24dfdbbfc615 (diff) | |
download | chromium_src-859bcc91dc0cca4984fceecfe406c6042d209fe6.zip chromium_src-859bcc91dc0cca4984fceecfe406c6042d209fe6.tar.gz chromium_src-859bcc91dc0cca4984fceecfe406c6042d209fe6.tar.bz2 |
Made MediaFilter::host_ and MediaFilter::message_loop_ private.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20335 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base')
-rw-r--r-- | media/base/filters.h | 19 | ||||
-rw-r--r-- | media/base/mock_media_filters.h | 20 | ||||
-rw-r--r-- | media/base/pipeline_impl.cc | 4 |
3 files changed, 25 insertions, 18 deletions
diff --git a/media/base/filters.h b/media/base/filters.h index bc94d39..9fd1b2e 100644 --- a/media/base/filters.h +++ b/media/base/filters.h @@ -58,26 +58,34 @@ class MediaFilter : public base::RefCountedThreadSafe<MediaFilter> { public: MediaFilter() : host_(NULL), message_loop_(NULL) {} - // Sets the protected member |host_|. This is the first method called by + // Sets the private member |host_|. This is the first method called by // the FilterHost after a filter is created. The host holds a strong // reference to the filter. The reference held by the host is guaranteed // to be released before the host object is destroyed by the pipeline. - virtual void SetFilterHost(FilterHost* host) { + virtual void set_host(FilterHost* host) { DCHECK(host); DCHECK(!host_); host_ = host; } - // Sets the protected member |message_loop_|, which is used by filters for + virtual FilterHost* host() { + return host_; + } + + // Sets the private member |message_loop_|, which is used by filters for // processing asynchronous tasks and maintaining synchronized access to // internal data members. The message loop should be running and exceed the // lifetime of the filter. - virtual void SetMessageLoop(MessageLoop* message_loop) { + virtual void set_message_loop(MessageLoop* message_loop) { DCHECK(message_loop); DCHECK(!message_loop_); message_loop_ = message_loop; } + virtual MessageLoop* message_loop() { + return message_loop_; + } + // The pipeline is being stopped either as a result of an error or because // the client called Stop(). virtual void Stop() = 0; @@ -95,11 +103,10 @@ class MediaFilter : public base::RefCountedThreadSafe<MediaFilter> { friend class base::RefCountedThreadSafe<MediaFilter>; virtual ~MediaFilter() {} - // TODO(scherkus): make these private with public/protected accessors. + private: FilterHost* host_; MessageLoop* message_loop_; - private: DISALLOW_COPY_AND_ASSIGN(MediaFilter); }; diff --git a/media/base/mock_media_filters.h b/media/base/mock_media_filters.h index b8749d9..698815f 100644 --- a/media/base/mock_media_filters.h +++ b/media/base/mock_media_filters.h @@ -105,15 +105,15 @@ class MockDataSource : public DataSource { media_format_.SetAsString(MediaFormat::kMimeType, mime_type::kApplicationOctetStream); media_format_.SetAsString(MediaFormat::kURL, url); - host_->SetTotalBytes(config_->media_total_bytes); + host()->SetTotalBytes(config_->media_total_bytes); switch (config_->data_source_behavior) { case MOCK_DATA_SOURCE_NORMAL_INIT: - host_->InitializationComplete(); + host()->InitializationComplete(); return true; case MOCK_DATA_SOURCE_NEVER_INIT: return true; case MOCK_DATA_SOURCE_URL_ERROR_IN_INIT: - host_->Error(PIPELINE_ERROR_URL_NOT_FOUND); + host()->Error(PIPELINE_ERROR_URL_NOT_FOUND); return false; case MOCK_DATA_SOURCE_INIT_RETURN_FALSE: return false; @@ -234,7 +234,7 @@ class MockDemuxer : public Demuxer { // Implementation of Demuxer. virtual bool Initialize(DataSource* data_source) { - host_->InitializationComplete(); + host()->InitializationComplete(); return true; } @@ -299,7 +299,7 @@ class MockAudioDecoder : public AudioDecoder { // Implementation of AudioDecoder. virtual bool Initialize(DemuxerStream* stream) { - host_->InitializationComplete(); + host()->InitializationComplete(); return true; } @@ -338,7 +338,7 @@ class MockAudioRenderer : public AudioRenderer { // Implementation of AudioRenderer. virtual bool Initialize(AudioDecoder* decoder) { - host_->InitializationComplete(); + host()->InitializationComplete(); return true; } @@ -404,7 +404,7 @@ class MockVideoDecoder : public VideoDecoder { // Implementation of VideoDecoder. virtual bool Initialize(DemuxerStream* stream) { - host_->InitializationComplete(); + host()->InitializationComplete(); return true; } @@ -436,7 +436,7 @@ class MockVideoDecoder : public VideoDecoder { config_->frame_duration, &frame); if (!frame) { - host_->Error(PIPELINE_ERROR_OUT_OF_MEMORY); + host()->Error(PIPELINE_ERROR_OUT_OF_MEMORY); ADD_FAILURE(); } else { mock_frame_time_ += config_->frame_duration; @@ -475,8 +475,8 @@ class MockVideoRenderer : public VideoRenderer { // Implementation of VideoRenderer. virtual bool Initialize(VideoDecoder* decoder) { - host_->SetVideoSize(config_->video_width, config_->video_height); - host_->InitializationComplete(); + host()->SetVideoSize(config_->video_width, config_->video_height); + host()->InitializationComplete(); return true; } diff --git a/media/base/pipeline_impl.cc b/media/base/pipeline_impl.cc index e9edc4f..56a71a6 100644 --- a/media/base/pipeline_impl.cc +++ b/media/base/pipeline_impl.cc @@ -604,7 +604,7 @@ void PipelineThread::CreateFilter(FilterFactory* filter_factory, NOTREACHED() << "Could not start filter thread"; Error(PIPELINE_ERROR_INITIALIZATION_FAILED); } else { - filter->SetMessageLoop(thread->message_loop()); + filter->set_message_loop(thread->message_loop()); filter_threads_.push_back(thread.release()); } } @@ -612,7 +612,7 @@ void PipelineThread::CreateFilter(FilterFactory* filter_factory, // Creating a thread could have failed, verify we're still OK. if (IsPipelineOk()) { filter_hosts_.push_back(host.get()); - filter->SetFilterHost(host.release()); + filter->set_host(host.release()); if (!filter->Initialize(source)) { Error(PIPELINE_ERROR_INITIALIZATION_FAILED); } |