Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3913)

Unified Diff: cc/CCProxy.cpp

Issue 11048044: cc: Switch to Chromium DCHECKs and LOGs (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/CCProxy.cpp
diff --git a/cc/CCProxy.cpp b/cc/CCProxy.cpp
index bc5ae69a57b362022d0022cc5c4a2b7e4d7e8ef3..bf93ca00f2f84ea393aa535b75fdfa7adc8af5df 100644
--- a/cc/CCProxy.cpp
+++ b/cc/CCProxy.cpp
@@ -13,11 +13,9 @@ using namespace WTF;
namespace cc {
namespace {
-#ifndef NDEBUG
bool implThreadIsOverridden = false;
bool s_isMainThreadBlocked = false;
base::PlatformThreadId threadIDOverridenToBeImplThread;
-#endif
CCThread* s_mainThread = 0;
CCThread* s_implThread = 0;
}
@@ -57,10 +55,12 @@ CCThread* CCProxy::currentThread()
return 0;
}
-#ifndef NDEBUG
bool CCProxy::isMainThread()
{
- ASSERT(s_mainThread);
+ if (!DCHECK_IS_ON())
+ return true;
+
+ DCHECK(s_mainThread);
if (implThreadIsOverridden && base::PlatformThread::CurrentId() == threadIDOverridenToBeImplThread)
return false;
return base::PlatformThread::CurrentId() == s_mainThread->threadID();
@@ -68,6 +68,9 @@ bool CCProxy::isMainThread()
bool CCProxy::isImplThread()
{
+ if (!DCHECK_IS_ON())
+ return true;
+
base::PlatformThreadId implThreadID = s_implThread ? s_implThread->threadID() : 0;
if (implThreadIsOverridden && base::PlatformThread::CurrentId() == threadIDOverridenToBeImplThread)
return true;
@@ -76,6 +79,9 @@ bool CCProxy::isImplThread()
void CCProxy::setCurrentThreadIsImplThread(bool isImplThread)
{
+ if (!DCHECK_IS_ON())
+ return;
+
implThreadIsOverridden = isImplThread;
if (isImplThread)
threadIDOverridenToBeImplThread = base::PlatformThread::CurrentId();
@@ -83,23 +89,26 @@ void CCProxy::setCurrentThreadIsImplThread(bool isImplThread)
bool CCProxy::isMainThreadBlocked()
{
+ if (!DCHECK_IS_ON())
+ return true;
return s_isMainThreadBlocked;
}
void CCProxy::setMainThreadBlocked(bool isMainThreadBlocked)
{
+ if (!DCHECK_IS_ON())
+ return;
s_isMainThreadBlocked = isMainThreadBlocked;
}
-#endif
CCProxy::CCProxy()
{
- ASSERT(isMainThread());
+ DCHECK(isMainThread());
}
CCProxy::~CCProxy()
{
- ASSERT(isMainThread());
+ DCHECK(isMainThread());
}
}
« cc/CCCompletionEvent.h ('K') | « cc/CCProxy.h ('k') | cc/CCQuadCuller.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698