summaryrefslogtreecommitdiffstats
path: root/cc/proxy.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc/proxy.cc')
-rw-r--r--cc/proxy.cc19
1 files changed, 7 insertions, 12 deletions
diff --git a/cc/proxy.cc b/cc/proxy.cc
index 317499c37..7b738aa 100644
--- a/cc/proxy.cc
+++ b/cc/proxy.cc
@@ -6,7 +6,7 @@
#include "cc/proxy.h"
-#include "cc/thread_task.h"
+#include "cc/thread.h"
namespace cc {
@@ -14,7 +14,6 @@ namespace {
#ifndef NDEBUG
bool implThreadIsOverridden = false;
bool s_isMainThreadBlocked = false;
-base::PlatformThreadId threadIDOverridenToBeImplThread;
#endif
Thread* s_mainThread = 0;
Thread* s_implThread = 0;
@@ -47,10 +46,9 @@ Thread* Proxy::implThread()
Thread* Proxy::currentThread()
{
- base::PlatformThreadId currentThreadIdentifier = base::PlatformThread::CurrentId();
- if (s_mainThread && s_mainThread->threadID() == currentThreadIdentifier)
+ if (s_mainThread && s_mainThread->belongsToCurrentThread())
return s_mainThread;
- if (s_implThread && s_implThread->threadID() == currentThreadIdentifier)
+ if (s_implThread && s_implThread->belongsToCurrentThread())
return s_implThread;
return 0;
}
@@ -59,9 +57,9 @@ bool Proxy::isMainThread()
{
#ifndef NDEBUG
DCHECK(s_mainThread);
- if (implThreadIsOverridden && base::PlatformThread::CurrentId() == threadIDOverridenToBeImplThread)
+ if (implThreadIsOverridden)
return false;
- return base::PlatformThread::CurrentId() == s_mainThread->threadID();
+ return s_mainThread->belongsToCurrentThread();
#else
return true;
#endif
@@ -70,10 +68,9 @@ bool Proxy::isMainThread()
bool Proxy::isImplThread()
{
#ifndef NDEBUG
- base::PlatformThreadId implThreadID = s_implThread ? s_implThread->threadID() : 0;
- if (implThreadIsOverridden && base::PlatformThread::CurrentId() == threadIDOverridenToBeImplThread)
+ if (implThreadIsOverridden)
return true;
- return base::PlatformThread::CurrentId() == implThreadID;
+ return s_implThread && s_implThread->belongsToCurrentThread();
#else
return true;
#endif
@@ -83,8 +80,6 @@ bool Proxy::isImplThread()
void Proxy::setCurrentThreadIsImplThread(bool isImplThread)
{
implThreadIsOverridden = isImplThread;
- if (isImplThread)
- threadIDOverridenToBeImplThread = base::PlatformThread::CurrentId();
}
#endif