Changeset 116833 in webkit
- Timestamp:
- May 11, 2012 7:04:46 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r116832 r116833 1 2012-05-11 Adrienne Walker <enne@google.com> 2 3 [chromium] Prevent deadlock on CCVideoLayerImpl destruction 4 https://bugs.webkit.org/show_bug.cgi?id=86258 5 6 Reviewed by James Robinson. 7 8 ~CCVideoLayerImpl had a common deadlock issue where if it got 9 destroyed before WebMediaPlayerClientImpl, it would take a lock, 10 call WebMediaPlayerClientImpl::setVideoFrameProviderClient(0), 11 which in turn would call CCVideoLayerImpl::stopUsingProvider(), 12 which would try to take the same lock and would deadlock. 13 14 CCVideoLayerImpl is only created and destroyed during tree 15 synchronization in a commit or during synchronous compositor thread 16 destruction. In either case, the main thread is blocked, and so no 17 lock needs to be taken at all. 18 19 * platform/graphics/chromium/cc/CCVideoLayerImpl.cpp: 20 (WebCore::CCVideoLayerImpl::CCVideoLayerImpl): 21 (WebCore::CCVideoLayerImpl::~CCVideoLayerImpl): 22 (WebCore::CCVideoLayerImpl::stopUsingProvider): 23 1 24 2012-05-11 Jeffrey Pfau <jpfau@apple.com> 2 25 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp
r115281 r116833 81 81 { 82 82 memcpy(m_streamTextureMatrix, flipTransform, sizeof(m_streamTextureMatrix)); 83 provider->setVideoFrameProviderClient(this); 83 84 // This only happens during a commit on the compositor thread while the main 85 // thread is blocked. That makes this a thread-safe call to set the video 86 // frame provider client that does not require a lock. The same is true of 87 // the call in the destructor. 88 m_provider->setVideoFrameProviderClient(this); 84 89 } 85 90 86 91 CCVideoLayerImpl::~CCVideoLayerImpl() 87 92 { 88 MutexLocker locker(m_providerMutex);93 // See comment in constructor for why this doesn't need a lock. 89 94 if (m_provider) { 90 95 m_provider->setVideoFrameProviderClient(0); … … 97 102 void CCVideoLayerImpl::stopUsingProvider() 98 103 { 104 // Block the provider from shutting down until this client is done 105 // using the frame. 99 106 MutexLocker locker(m_providerMutex); 107 ASSERT(!m_frame); 100 108 m_provider = 0; 101 109 }
Note: See TracChangeset
for help on using the changeset viewer.