diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 19:29:39 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 19:29:39 +0000 |
commit | 70ab61c9109f3626b44f2bee96de626d0acf8442 (patch) | |
tree | a576bc8931b3520805246c4b14497416b21cd46d /chrome/renderer/media/buffered_data_source.h | |
parent | 682f714c3a4864858ff3eabf1f80d4c6fca71647 (diff) | |
download | chromium_src-70ab61c9109f3626b44f2bee96de626d0acf8442.zip chromium_src-70ab61c9109f3626b44f2bee96de626d0acf8442.tar.gz chromium_src-70ab61c9109f3626b44f2bee96de626d0acf8442.tar.bz2 |
Access RenderThread::current() only on render thread
Since the renfer to RenderThread is now stored in the
thread local storage, we can only access RenderThread::current()
from render thread. Change BufferedDataSource accordingly.
Review URL: http://codereview.chromium.org/126183
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18513 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/media/buffered_data_source.h')
-rw-r--r-- | chrome/renderer/media/buffered_data_source.h | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/chrome/renderer/media/buffered_data_source.h b/chrome/renderer/media/buffered_data_source.h index b5a0d91..0111629 100644 --- a/chrome/renderer/media/buffered_data_source.h +++ b/chrome/renderer/media/buffered_data_source.h @@ -30,7 +30,14 @@ class BufferedResourceLoader : public base::RefCountedThreadSafe<BufferedResourceLoader>, public webkit_glue::ResourceLoaderBridge::Peer { public: - BufferedResourceLoader(int32 routing_id, + // |message_loop| - The message loop this resource loader should run on. + // |routing_id| - Routing id to this view. + // |url| - URL for the resource to be loaded. + // |first_byte_position| - First byte to start loading from, -1 for not + // specified. + // |last_byte_position| - Last byte to be loaded, -1 for not specified. + BufferedResourceLoader(MessageLoop* message_loop, + int32 routing_id, const GURL& url, int64 first_byte_position, int64 last_byte_position); @@ -187,8 +194,11 @@ class BufferedDataSource : public media::DataSource { public: // Methods called from pipeline thread // Static methods for creating this class. - static media::FilterFactory* CreateFactory(int32 routing_id) { - return new media::FilterFactoryImpl1<BufferedDataSource, int32>(routing_id); + static media::FilterFactory* CreateFactory(MessageLoop* message_loop, + int32 routing_id) { + return new media::FilterFactoryImpl2<BufferedDataSource, + MessageLoop*, + int32>(message_loop, routing_id); } virtual bool Initialize(const std::string& url); @@ -206,7 +216,9 @@ class BufferedDataSource : public media::DataSource { const media::MediaFormat& media_format(); private: - friend class media::FilterFactoryImpl1<BufferedDataSource, int32>; + friend class media::FilterFactoryImpl2<BufferedDataSource, + MessageLoop*, + int32>; // Call to filter host to trigger an error, be sure not to call this method // while the lock is acquired. void HandleError(media::PipelineError error); @@ -217,7 +229,7 @@ class BufferedDataSource : public media::DataSource { void InitialRequestStarted(int error); void OnInitialRequestStarted(int error); - explicit BufferedDataSource(int32 routing_id); + explicit BufferedDataSource(MessageLoop* render_loop, int32 routing_id); virtual ~BufferedDataSource(); media::MediaFormat media_format_; @@ -237,6 +249,9 @@ class BufferedDataSource : public media::DataSource { // Members related to resource loading with RenderView. scoped_refptr<BufferedResourceLoader> buffered_resource_loader_; + // The message loop of the render thread. + MessageLoop* render_loop_; + // The message loop of the pipeline thread. MessageLoop* pipeline_loop_; |