diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-11 20:43:33 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-11 20:43:33 +0000 |
commit | 5a7bba01db74c0cd9e65793ac4bc757e7b5eedcf (patch) | |
tree | 098a284b8031ae0206a3ae4b2586e6ec46a098c1 /content/renderer/render_thread_impl.h | |
parent | 2ddaba26a1f39ff99baa3b485200eb1fce4975b0 (diff) | |
download | chromium_src-5a7bba01db74c0cd9e65793ac4bc757e7b5eedcf.zip chromium_src-5a7bba01db74c0cd9e65793ac4bc757e7b5eedcf.tar.gz chromium_src-5a7bba01db74c0cd9e65793ac4bc757e7b5eedcf.tar.bz2 |
Revert 244074 "Eliminate video capture thread in renderer"
Caused lots of races on the tsan bot:
http://build.chromium.org/p/chromium.memory.fyi/builders/Linux%20Tests%20%28tsan%29%283%29?numbuilds=200
Example:
ThreadSanitizer:Race
fun:std::_Rb_tree::_M_begin
fun:std::_Rb_tree::~_Rb_tree
fun:std::map::~map
fun:content::VideoCaptureImpl::~VideoCaptureImpl
fun:content::MockVideoCaptureImpl::~MockVideoCaptureImpl
fun:content::MockVideoCaptureImpl::~MockVideoCaptureImpl
fun:linked_ptr::depart
fun:linked_ptr::~linked_ptr
fun:std::pair::~pair
fun:std::pair::~pair
fun:__gnu_cxx::new_allocator::destroy
fun:std::_Rb_tree::_M_destroy_node
fun:std::_Rb_tree::_M_erase
fun:std::_Rb_tree::~_Rb_tree
fun:std::map::~map
fun:content::VideoCaptureImplManager::~VideoCaptureImplManager
ThreadSanitizer:Race
fun:std::_Rb_tree::_M_begin
fun:std::_Rb_tree::~_Rb_tree
fun:std::map::~map
fun:content::VideoCaptureImpl::~VideoCaptureImpl
fun:content::VideoCaptureImplTest::MockVideoCaptureImpl::~MockVideoCaptureImpl
fun:content::VideoCaptureImplTest::MockVideoCaptureImpl::~MockVideoCaptureImpl
fun:content::VideoCaptureImplTest::~VideoCaptureImplTest
fun:content::VideoCaptureImplTest_TwoClientsInSequence_Test::~VideoCaptureImplTest_TwoClientsInSequence_Test
fun:content::VideoCaptureImplTest_TwoClientsInSequence_Test::~VideoCaptureImplTest_TwoClientsInSequence_Test
fun:testing::Test::DeleteSelf_
> Eliminate video capture thread in renderer
>
> The main motivation of this change is to remove the video capture thread
> in the renderer. All users of a video capture device already handles the
> video frame on their thread. There is no need to call the clients with
> an additional thread.
>
> Summary of this change:
> * Video capture thread eliminated
> VideoCaptureImpl now runs on the IO thread. Clients are called on the
> IO thread.
> * Simplified VideoCaptureImplManager
> We still need to keep this object for the purpose of sharing a
> VideoCaptureImpl object with multiple clients. It should own these
> objects and maintain the usage count. A couple clean up items are done
> on this class:
> * It doesn't own the video capture thread now.
> * It is now a render thread only object.
> * It maintains refcount of a VideoCaptureImpl explicitly.
> * It is no longer refcounted.
> * Clients access it through RenderThreadImpl. Which ensures usage is
> on the render thread.
> * New VideoCaptureHandle class
> Object of this class is returned by VideoCaptureImplManager to give
> access to a media::VideoCapture object. It is purely a wrapper and
> helps to do refcounting on the render thread.
>
> Testing:
> Added unit tests for VideoCaptureImplManager to test refcounting.
> Also updated unit test for VideoCaptureImpl due to the threading
> changes.
>
> Review URL: https://codereview.chromium.org/120893002
TBR=hclam@chromium.org
Review URL: https://codereview.chromium.org/135683002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244358 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/render_thread_impl.h')
-rw-r--r-- | content/renderer/render_thread_impl.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h index c4f7fc6..defde7c 100644 --- a/content/renderer/render_thread_impl.h +++ b/content/renderer/render_thread_impl.h @@ -431,8 +431,8 @@ class CONTENT_EXPORT RenderThreadImpl : public RenderThread, // Dispatches all P2P sockets. scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_; - // Used on the render thread. - scoped_ptr<VideoCaptureImplManager> vc_manager_; + // Used on multiple threads. + scoped_refptr<VideoCaptureImplManager> vc_manager_; // The count of RenderWidgets running through this thread. int widget_count_; |