diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-25 17:45:51 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-25 17:45:51 +0000 |
commit | 8380c0910bfff5ee0af6b37536cd815023d055ef (patch) | |
tree | e8a4850c7aa9738f1fc3706cdbcd32efd6f77b6e /webkit/glue/media/simple_data_source.h | |
parent | 5de4b03e3bcd97feae59de8828704088f97c5705 (diff) | |
download | chromium_src-8380c0910bfff5ee0af6b37536cd815023d055ef.zip chromium_src-8380c0910bfff5ee0af6b37536cd815023d055ef.tar.gz chromium_src-8380c0910bfff5ee0af6b37536cd815023d055ef.tar.bz2 |
Refactorying to create the ResourceLoaderBridge through a factory class for <video>
Extract the code to create a ResourceLoaderBridge to a factory class
to enable testing on the data source filters.
Review URL: http://codereview.chromium.org/146007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19262 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/media/simple_data_source.h')
-rw-r--r-- | webkit/glue/media/simple_data_source.h | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/webkit/glue/media/simple_data_source.h b/webkit/glue/media/simple_data_source.h index 55693ff..7918034 100644 --- a/webkit/glue/media/simple_data_source.h +++ b/webkit/glue/media/simple_data_source.h @@ -14,7 +14,7 @@ #include "base/scoped_ptr.h" #include "media/base/factory.h" #include "media/base/filters.h" -#include "webkit/glue/resource_loader_bridge.h" +#include "webkit/glue/media/media_resource_loader_bridge_factory.h" class MessageLoop; class WebMediaPlayerDelegateImpl; @@ -24,11 +24,14 @@ namespace webkit_glue { class SimpleDataSource : public media::DataSource, public webkit_glue::ResourceLoaderBridge::Peer { public: - static media::FilterFactory* CreateFactory(MessageLoop* message_loop, - int32 routing_id) { - return new media::FilterFactoryImpl2<SimpleDataSource, - MessageLoop*, - int32>(message_loop, routing_id); + static media::FilterFactory* CreateFactory( + MessageLoop* message_loop, + webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory) { + return new media::FilterFactoryImpl2< + SimpleDataSource, + MessageLoop*, + webkit_glue::MediaResourceLoaderBridgeFactory*>(message_loop, + bridge_factory); } // MediaFilter implementation. @@ -56,8 +59,13 @@ class SimpleDataSource : public media::DataSource, virtual std::string GetURLForDebugging(); private: - friend class media::FilterFactoryImpl2<SimpleDataSource, MessageLoop*, int32>; - SimpleDataSource(MessageLoop* render_loop, int32 routing_id); + friend class media::FilterFactoryImpl2< + SimpleDataSource, + MessageLoop*, + webkit_glue::MediaResourceLoaderBridgeFactory*>; + SimpleDataSource( + MessageLoop* render_loop, + webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory); virtual ~SimpleDataSource(); // Updates |url_| and |media_format_| with the given URL. @@ -69,12 +77,12 @@ class SimpleDataSource : public media::DataSource, // Cancels and deletes the resource loading on the render thread. void CancelTask(); - // Passed in during construction, used when creating the bridge. - int32 routing_id_; - // Primarily used for asserting the bridge is loading on the render thread. MessageLoop* render_loop_; + // Factory to create a bridge. + scoped_ptr<webkit_glue::MediaResourceLoaderBridgeFactory> bridge_factory_; + // Bridge used to load the media resource. scoped_ptr<webkit_glue::ResourceLoaderBridge> bridge_; |