| Index: cc/proxy.cc
|
| diff --git a/cc/proxy.cc b/cc/proxy.cc
|
| index 317499c3721c2785caa6febe3ca1a45f4d4b3624..7b738aa5a5bd891ccfb5826cf51c579fb6d323e0 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
|
|
|
|
|