diff options
author | acolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-16 17:14:25 +0000 |
---|---|---|
committer | acolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-16 17:14:25 +0000 |
commit | 236119cf32eb61f4b775ba573ecf46a1c504e7a3 (patch) | |
tree | 9a292fdefecf37aa48d448f3f7706ab5521e4d33 /webkit | |
parent | 7046bfcb6c8f46d0693c129d52de27bc68042af7 (diff) | |
download | chromium_src-236119cf32eb61f4b775ba573ecf46a1c504e7a3.zip chromium_src-236119cf32eb61f4b775ba573ecf46a1c504e7a3.tar.gz chromium_src-236119cf32eb61f4b775ba573ecf46a1c504e7a3.tar.bz2 |
Removing DataSource from Filter hierarchy and refactoring FilterHost into DemuxerHost & DataSourceHost.
Over the last year, several refactorings have caused DataSource to have almost nothing in common with the Filter interface. This change removes it from the Filter class hierarchy and splits up the FilterHost interface so that DataSource, Demuxer, and Filter have their own host interfaces. Splitting FilterHost improves encapsulation and makes it easier to reason about which host methods are required by different parts of the code.
BUG=
TEST=media_unittests
Review URL: http://codereview.chromium.org/8936014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114819 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/media/buffered_data_source.cc | 10 | ||||
-rw-r--r-- | webkit/media/buffered_data_source.h | 9 | ||||
-rw-r--r-- | webkit/media/buffered_data_source_unittest.cc | 4 | ||||
-rw-r--r-- | webkit/media/simple_data_source.cc | 3 | ||||
-rw-r--r-- | webkit/media/simple_data_source.h | 8 | ||||
-rw-r--r-- | webkit/media/simple_data_source_unittest.cc | 4 | ||||
-rw-r--r-- | webkit/media/web_data_source.h | 2 | ||||
-rw-r--r-- | webkit/media/webmediaplayer_proxy.h | 4 |
8 files changed, 21 insertions, 23 deletions
diff --git a/webkit/media/buffered_data_source.cc b/webkit/media/buffered_data_source.cc index 794c40e..20b9b7a 100644 --- a/webkit/media/buffered_data_source.cc +++ b/webkit/media/buffered_data_source.cc @@ -5,7 +5,6 @@ #include "webkit/media/buffered_data_source.h" #include "base/bind.h" -#include "media/base/filter_host.h" #include "media/base/media_log.h" #include "net/base/net_errors.h" #include "webkit/media/web_data_source_factory.h" @@ -85,7 +84,7 @@ BufferedResourceLoader* BufferedDataSource::CreateResourceLoader( media_log_); } -void BufferedDataSource::set_host(media::FilterHost* host) { +void BufferedDataSource::set_host(media::DataSourceHost* host) { DataSource::set_host(host); if (loader_.get()) { @@ -650,13 +649,12 @@ void BufferedDataSource::UpdateHostState_Locked() { // Called from various threads, under lock. lock_.AssertAcquired(); - media::FilterHost* filter_host = host(); - if (!filter_host) + if (!host()) return; if (total_bytes_ != kPositionNotSpecified) - filter_host->SetTotalBytes(total_bytes_); - filter_host->SetBufferedBytes(buffered_bytes_); + host()->SetTotalBytes(total_bytes_); + host()->SetBufferedBytes(buffered_bytes_); } } // namespace webkit_media diff --git a/webkit/media/buffered_data_source.h b/webkit/media/buffered_data_source.h index 11210b9..eac8e13 100644 --- a/webkit/media/buffered_data_source.h +++ b/webkit/media/buffered_data_source.h @@ -11,7 +11,7 @@ #include "base/memory/scoped_ptr.h" #include "base/synchronization/lock.h" #include "media/base/filter_factories.h" -#include "media/base/filters.h" +#include "media/base/data_source.h" #include "webkit/media/buffered_resource_loader.h" namespace media { @@ -37,13 +37,12 @@ class BufferedDataSource : public WebDataSource { virtual ~BufferedDataSource(); - // media::Filter implementation. - virtual void set_host(media::FilterHost* host) OVERRIDE; + // media::DataSource implementation. + // Called from demuxer thread. + virtual void set_host(media::DataSourceHost* host) OVERRIDE; virtual void Stop(const base::Closure& callback) OVERRIDE; virtual void SetPlaybackRate(float playback_rate) OVERRIDE; - // media::DataSource implementation. - // Called from demuxer thread. virtual void Read( int64 position, size_t size, diff --git a/webkit/media/buffered_data_source_unittest.cc b/webkit/media/buffered_data_source_unittest.cc index 83d58cf..9150fd0 100644 --- a/webkit/media/buffered_data_source_unittest.cc +++ b/webkit/media/buffered_data_source_unittest.cc @@ -5,7 +5,7 @@ #include "base/bind.h" #include "media/base/media_log.h" #include "media/base/mock_callback.h" -#include "media/base/mock_filter_host.h" +#include "media/base/mock_data_source_host.h" #include "media/base/mock_filters.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLResponse.h" @@ -176,7 +176,7 @@ class BufferedDataSourceTest : public testing::Test { MockWebFrameClient client_; WebView* view_; - StrictMock<media::MockFilterHost> host_; + StrictMock<media::MockDataSourceHost> host_; MessageLoop* message_loop_; private: diff --git a/webkit/media/simple_data_source.cc b/webkit/media/simple_data_source.cc index 24b7b01..cc950dc 100644 --- a/webkit/media/simple_data_source.cc +++ b/webkit/media/simple_data_source.cc @@ -7,7 +7,6 @@ #include "base/bind.h" #include "base/message_loop.h" #include "base/process_util.h" -#include "media/base/filter_host.h" #include "media/base/media_log.h" #include "net/base/data_url.h" #include "net/base/load_flags.h" @@ -59,7 +58,7 @@ SimpleDataSource::~SimpleDataSource() { DCHECK(state_ == UNINITIALIZED || state_ == STOPPED); } -void SimpleDataSource::set_host(media::FilterHost* host) { +void SimpleDataSource::set_host(media::DataSourceHost* host) { DataSource::set_host(host); base::AutoLock auto_lock(lock_); diff --git a/webkit/media/simple_data_source.h b/webkit/media/simple_data_source.h index 7408019..e905be9 100644 --- a/webkit/media/simple_data_source.h +++ b/webkit/media/simple_data_source.h @@ -16,7 +16,7 @@ #include "base/memory/scoped_ptr.h" #include "base/message_loop.h" #include "media/base/filter_factories.h" -#include "media/base/filters.h" +#include "media/base/data_source.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLLoader.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLLoaderClient.h" @@ -46,11 +46,9 @@ class SimpleDataSource SimpleDataSource(MessageLoop* render_loop, WebKit::WebFrame* frame); virtual ~SimpleDataSource(); - // media::Filter implementation. - virtual void set_host(media::FilterHost* host) OVERRIDE; - virtual void Stop(const base::Closure& callback) OVERRIDE; - // media::DataSource implementation. + virtual void set_host(media::DataSourceHost* host) OVERRIDE; + virtual void Stop(const base::Closure& callback) OVERRIDE; virtual void Read(int64 position, size_t size, uint8* data, diff --git a/webkit/media/simple_data_source_unittest.cc b/webkit/media/simple_data_source_unittest.cc index fd99202..a21135f 100644 --- a/webkit/media/simple_data_source_unittest.cc +++ b/webkit/media/simple_data_source_unittest.cc @@ -5,7 +5,7 @@ #include "base/bind.h" #include "media/base/filters.h" #include "media/base/mock_callback.h" -#include "media/base/mock_filter_host.h" +#include "media/base/mock_data_source_host.h" #include "media/base/mock_filters.h" #include "net/base/net_errors.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" @@ -154,7 +154,7 @@ class SimpleDataSourceTest : public testing::Test { scoped_ptr<MessageLoop> message_loop_; NiceMock<MockWebURLLoader>* url_loader_; scoped_refptr<SimpleDataSource> data_source_; - StrictMock<media::MockFilterHost> host_; + StrictMock<media::MockDataSourceHost> host_; MockWebFrameClient client_; WebView* view_; diff --git a/webkit/media/web_data_source.h b/webkit/media/web_data_source.h index 5cb27c4..e492e88 100644 --- a/webkit/media/web_data_source.h +++ b/webkit/media/web_data_source.h @@ -6,7 +6,7 @@ #define WEBKIT_MEDIA_WEB_DATA_SOURCE_H_ #include "base/callback.h" -#include "media/base/filters.h" +#include "media/base/data_source.h" #include "media/base/pipeline_status.h" namespace webkit_media { diff --git a/webkit/media/webmediaplayer_proxy.h b/webkit/media/webmediaplayer_proxy.h index 3cff7a4..83877e4 100644 --- a/webkit/media/webmediaplayer_proxy.h +++ b/webkit/media/webmediaplayer_proxy.h @@ -20,6 +20,10 @@ namespace gfx { class Rect; } +namespace media { +class VideoFrame; +} + namespace webkit_media { class WebMediaPlayerImpl; |