[chromium] Prevent deadlock on CCVideoLayerImpl destruction
authorenne@google.com <enne@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 12 May 2012 02:04:46 +0000 (02:04 +0000)
committerenne@google.com <enne@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 12 May 2012 02:04:46 +0000 (02:04 +0000)
commit427db55a6e1216757683b7494a7cb2f4eff951a8
tree99ee94634d33c1c9cda76cd320f5c7b82c46ce1a
parentfbc4292be6641c1f61e599685cb21decf20dd4b5
[chromium] Prevent deadlock on CCVideoLayerImpl destruction
https://bugs.webkit.org/show_bug.cgi?id=86258

Reviewed by James Robinson.

~CCVideoLayerImpl had a common deadlock issue where if it got
destroyed before WebMediaPlayerClientImpl, it would take a lock,
call WebMediaPlayerClientImpl::setVideoFrameProviderClient(0),
which in turn would call CCVideoLayerImpl::stopUsingProvider(),
which would try to take the same lock and would deadlock.

CCVideoLayerImpl is only created and destroyed during tree
synchronization in a commit or during synchronous compositor thread
destruction. In either case, the main thread is blocked, and so no
lock needs to be taken at all.

* platform/graphics/chromium/cc/CCVideoLayerImpl.cpp:
(WebCore::CCVideoLayerImpl::CCVideoLayerImpl):
(WebCore::CCVideoLayerImpl::~CCVideoLayerImpl):
(WebCore::CCVideoLayerImpl::stopUsingProvider):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@116833 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp