summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-16 02:13:54 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-16 02:13:54 +0000
commitc0131a39a53f46594e6af35127f8c1b4e3bebd28 (patch)
treebeb0ba2f5e9932504f3034f0b35ecc06d420ebb1 /cc
parent581eca5dbef710697e43838ca60f2f221a3e39c2 (diff)
downloadchromium_src-c0131a39a53f46594e6af35127f8c1b4e3bebd28.zip
chromium_src-c0131a39a53f46594e6af35127f8c1b4e3bebd28.tar.gz
chromium_src-c0131a39a53f46594e6af35127f8c1b4e3bebd28.tar.bz2
Port from WTF::Mutex -> base::Lock in cc::VideoLayerImpl
BUG=154451 Review URL: https://chromiumcodereview.appspot.com/11144031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162047 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/video_layer_impl.cc10
-rw-r--r--cc/video_layer_impl.h5
2 files changed, 7 insertions, 8 deletions
diff --git a/cc/video_layer_impl.cc b/cc/video_layer_impl.cc
index 53e7a74..dee1360 100644
--- a/cc/video_layer_impl.cc
+++ b/cc/video_layer_impl.cc
@@ -63,7 +63,7 @@ void CCVideoLayerImpl::stopUsingProvider()
{
// Block the provider from shutting down until this client is done
// using the frame.
- MutexLocker locker(m_providerMutex);
+ base::AutoLock locker(m_providerLock);
ASSERT(!m_frame);
m_provider = 0;
}
@@ -91,20 +91,20 @@ void CCVideoLayerImpl::willDraw(CCResourceProvider* resourceProvider)
ASSERT(CCProxy::isImplThread());
CCLayerImpl::willDraw(resourceProvider);
- // Explicitly lock and unlock the provider mutex so it can be held from
+ // Explicitly acquire and release the provider mutex so it can be held from
// willDraw to didDraw. Since the compositor thread is in the middle of
// drawing, the layer will not be destroyed before didDraw is called.
// Therefore, the only thing that will prevent this lock from being released
// is the GPU process locking it. As the GPU process can't cause the
// destruction of the provider (calling stopUsingProvider), holding this
// lock should not cause a deadlock.
- m_providerMutex.lock();
+ m_providerLock.Acquire();
willDrawInternal(resourceProvider);
freeUnusedPlaneData(resourceProvider);
if (!m_frame)
- m_providerMutex.unlock();
+ m_providerLock.Release();
}
void CCVideoLayerImpl::willDrawInternal(CCResourceProvider* resourceProvider)
@@ -236,7 +236,7 @@ void CCVideoLayerImpl::didDraw(CCResourceProvider* resourceProvider)
m_provider->putCurrentFrame(m_frame);
m_frame = 0;
- m_providerMutex.unlock();
+ m_providerLock.Release();
}
static int videoFrameDimension(int originalDimension, unsigned plane, int format)
diff --git a/cc/video_layer_impl.h b/cc/video_layer_impl.h
index b254e8c..768cadb 100644
--- a/cc/video_layer_impl.h
+++ b/cc/video_layer_impl.h
@@ -5,6 +5,7 @@
#ifndef CCVideoLayerImpl_h
#define CCVideoLayerImpl_h
+#include "base/synchronization/lock.h"
#include "CCLayerImpl.h"
#include "GraphicsContext3D.h"
#include "IntSize.h"
@@ -35,8 +36,6 @@ public:
virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE;
- Mutex& providerMutex() { return m_providerMutex; }
-
// WebKit::WebVideoFrameProvider::Client implementation.
virtual void stopUsingProvider(); // Callable on any thread.
virtual void didReceiveFrame(); // Callable on impl thread.
@@ -71,7 +70,7 @@ private:
void freeUnusedPlaneData(CCResourceProvider*);
// Guards the destruction of m_provider and the frame that it provides
- Mutex m_providerMutex;
+ base::Lock m_providerLock;
WebKit::WebVideoFrameProvider* m_provider;
WebKit::WebTransformationMatrix m_streamTextureMatrix;