diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-18 18:15:04 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-18 18:15:04 +0000 |
commit | 1d99317a73040007668b1cdf134334f45d45600e (patch) | |
tree | 0da28120111aa69a339ec90ff05d7cac8b21cf77 /cc/video_layer_impl.cc | |
parent | 52f1a7e63128f2a4f644e1a28a6744b916585999 (diff) | |
download | chromium_src-1d99317a73040007668b1cdf134334f45d45600e.zip chromium_src-1d99317a73040007668b1cdf134334f45d45600e.tar.gz chromium_src-1d99317a73040007668b1cdf134334f45d45600e.tar.bz2 |
cc: Switch to Chromium DCHECKs LOGs
We can't compile-guard code and use DCHECK since it can be enabled at runtime. So we guard the DCHECKs that we want to rely on conditionally-compiled code in !NDEBUG compile guards.
This also replaces use of LOG_ERROR("Foo") with LOG(ERROR)<<"Foo";
This was previously discussed and committed as https://codereview.chromium.org/11048044/
using a guard based on LOGGING_IS_OFFICIAL_BUILD, however this was not sufficient since there are build configurations that are official builds but have dchecks compiled.
R=enne
Review URL: https://codereview.chromium.org/11192030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162739 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/video_layer_impl.cc')
-rw-r--r-- | cc/video_layer_impl.cc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/cc/video_layer_impl.cc b/cc/video_layer_impl.cc index dee1360..4da86d7 100644 --- a/cc/video_layer_impl.cc +++ b/cc/video_layer_impl.cc @@ -38,24 +38,24 @@ CCVideoLayerImpl::CCVideoLayerImpl(int id, WebKit::WebVideoFrameProvider* provid // thread is blocked. That makes this a thread-safe call to set the video // frame provider client that does not require a lock. The same is true of // the call in the destructor. - ASSERT(CCProxy::isMainThreadBlocked()); + DCHECK(CCProxy::isMainThreadBlocked()); m_provider->setVideoFrameProviderClient(this); } CCVideoLayerImpl::~CCVideoLayerImpl() { // See comment in constructor for why this doesn't need a lock. - ASSERT(CCProxy::isMainThreadBlocked()); + DCHECK(CCProxy::isMainThreadBlocked()); if (m_provider) { m_provider->setVideoFrameProviderClient(0); m_provider = 0; } freePlaneData(layerTreeHostImpl()->resourceProvider()); -#if !ASSERT_DISABLED +#ifndef NDEBUG for (unsigned i = 0; i < WebKit::WebVideoFrame::maxPlanes; ++i) - ASSERT(!m_framePlanes[i].resourceId); - ASSERT(!m_externalTextureResource); + DCHECK(!m_framePlanes[i].resourceId); + DCHECK(!m_externalTextureResource); #endif } @@ -64,7 +64,7 @@ void CCVideoLayerImpl::stopUsingProvider() // Block the provider from shutting down until this client is done // using the frame. base::AutoLock locker(m_providerLock); - ASSERT(!m_frame); + DCHECK(!m_frame); m_provider = 0; } @@ -88,7 +88,7 @@ static GC3Denum convertVFCFormatToGC3DFormat(const WebKit::WebVideoFrame& frame) void CCVideoLayerImpl::willDraw(CCResourceProvider* resourceProvider) { - ASSERT(CCProxy::isImplThread()); + DCHECK(CCProxy::isImplThread()); CCLayerImpl::willDraw(resourceProvider); // Explicitly acquire and release the provider mutex so it can be held from @@ -109,8 +109,8 @@ void CCVideoLayerImpl::willDraw(CCResourceProvider* resourceProvider) void CCVideoLayerImpl::willDrawInternal(CCResourceProvider* resourceProvider) { - ASSERT(CCProxy::isImplThread()); - ASSERT(!m_externalTextureResource); + DCHECK(CCProxy::isImplThread()); + DCHECK(!m_externalTextureResource); if (!m_provider) { m_frame = 0; @@ -154,7 +154,7 @@ void CCVideoLayerImpl::willDrawInternal(CCResourceProvider* resourceProvider) void CCVideoLayerImpl::appendQuads(CCQuadSink& quadSink, CCAppendQuadsData& appendQuadsData) { - ASSERT(CCProxy::isImplThread()); + DCHECK(CCProxy::isImplThread()); if (!m_frame) return; @@ -217,18 +217,18 @@ void CCVideoLayerImpl::appendQuads(CCQuadSink& quadSink, CCAppendQuadsData& appe void CCVideoLayerImpl::didDraw(CCResourceProvider* resourceProvider) { - ASSERT(CCProxy::isImplThread()); + DCHECK(CCProxy::isImplThread()); CCLayerImpl::didDraw(resourceProvider); if (!m_frame) return; if (m_format == GraphicsContext3D::TEXTURE_2D) { - ASSERT(m_externalTextureResource); + DCHECK(m_externalTextureResource); // FIXME: the following assert will not be true when sending resources to a // parent compositor. We will probably need to hold on to m_frame for // longer, and have several "current frames" in the pipeline. - ASSERT(!resourceProvider->inUseByConsumer(m_externalTextureResource)); + DCHECK(!resourceProvider->inUseByConsumer(m_externalTextureResource)); resourceProvider->deleteResource(m_externalTextureResource); m_externalTextureResource = 0; } |