diff options
Diffstat (limited to 'cc')
-rw-r--r-- | cc/CCProxy.cpp | 16 | ||||
-rw-r--r-- | cc/CCProxy.h | 1 | ||||
-rw-r--r-- | cc/CCScopedTexture.cpp | 4 | ||||
-rw-r--r-- | cc/CCScopedTexture.h | 4 | ||||
-rw-r--r-- | cc/CCScopedThreadProxy.h | 7 | ||||
-rw-r--r-- | cc/CCThread.h | 5 | ||||
-rw-r--r-- | cc/test/CCSchedulerTestCommon.h | 3 |
7 files changed, 21 insertions, 19 deletions
diff --git a/cc/CCProxy.cpp b/cc/CCProxy.cpp index 2e89398..b089442 100644 --- a/cc/CCProxy.cpp +++ b/cc/CCProxy.cpp @@ -17,7 +17,7 @@ namespace { #ifndef NDEBUG bool implThreadIsOverridden = false; bool s_isMainThreadBlocked = false; -ThreadIdentifier threadIDOverridenToBeImplThread; +base::PlatformThreadId threadIDOverridenToBeImplThread; #endif CCThread* s_mainThread = 0; CCThread* s_implThread = 0; @@ -50,7 +50,7 @@ CCThread* CCProxy::implThread() CCThread* CCProxy::currentThread() { - ThreadIdentifier currentThreadIdentifier = WTF::currentThread(); + base::PlatformThreadId currentThreadIdentifier = base::PlatformThread::CurrentId(); if (s_mainThread && s_mainThread->threadID() == currentThreadIdentifier) return s_mainThread; if (s_implThread && s_implThread->threadID() == currentThreadIdentifier) @@ -62,24 +62,24 @@ CCThread* CCProxy::currentThread() bool CCProxy::isMainThread() { ASSERT(s_mainThread); - if (implThreadIsOverridden && WTF::currentThread() == threadIDOverridenToBeImplThread) + if (implThreadIsOverridden && base::PlatformThread::CurrentId() == threadIDOverridenToBeImplThread) return false; - return WTF::currentThread() == s_mainThread->threadID(); + return base::PlatformThread::CurrentId() == s_mainThread->threadID(); } bool CCProxy::isImplThread() { - WTF::ThreadIdentifier implThreadID = s_implThread ? s_implThread->threadID() : 0; - if (implThreadIsOverridden && WTF::currentThread() == threadIDOverridenToBeImplThread) + base::PlatformThreadId implThreadID = s_implThread ? s_implThread->threadID() : 0; + if (implThreadIsOverridden && base::PlatformThread::CurrentId() == threadIDOverridenToBeImplThread) return true; - return WTF::currentThread() == implThreadID; + return base::PlatformThread::CurrentId() == implThreadID; } void CCProxy::setCurrentThreadIsImplThread(bool isImplThread) { implThreadIsOverridden = isImplThread; if (isImplThread) - threadIDOverridenToBeImplThread = WTF::currentThread(); + threadIDOverridenToBeImplThread = base::PlatformThread::CurrentId(); } bool CCProxy::isMainThreadBlocked() diff --git a/cc/CCProxy.h b/cc/CCProxy.h index f2cbc7d..486c132 100644 --- a/cc/CCProxy.h +++ b/cc/CCProxy.h @@ -10,7 +10,6 @@ #include <wtf/Noncopyable.h> #include <wtf/PassOwnPtr.h> #include <wtf/PassRefPtr.h> -#include <wtf/Threading.h> namespace WebCore { diff --git a/cc/CCScopedTexture.cpp b/cc/CCScopedTexture.cpp index b032680..524dfd4 100644 --- a/cc/CCScopedTexture.cpp +++ b/cc/CCScopedTexture.cpp @@ -28,7 +28,7 @@ bool CCScopedTexture::allocate(int pool, const IntSize& size, GC3Denum format, C setId(m_resourceProvider->createResource(pool, size, format, hint)); #if !ASSERT_DISABLED - m_allocateThreadIdentifier = WTF::currentThread(); + m_allocateThreadIdentifier = base::PlatformThread::CurrentId(); #endif return id(); @@ -37,7 +37,7 @@ bool CCScopedTexture::allocate(int pool, const IntSize& size, GC3Denum format, C void CCScopedTexture::free() { if (id()) { - ASSERT(m_allocateThreadIdentifier == WTF::currentThread()); + ASSERT(m_allocateThreadIdentifier == base::PlatformThread::CurrentId()); m_resourceProvider->deleteResource(id()); } setId(0); diff --git a/cc/CCScopedTexture.h b/cc/CCScopedTexture.h index c82b8bc..866c050c 100644 --- a/cc/CCScopedTexture.h +++ b/cc/CCScopedTexture.h @@ -8,7 +8,7 @@ #include "CCTexture.h" #if !ASSERT_DISABLED -#include <wtf/MainThread.h> +#include "base/threading/platform_thread.h" #endif namespace WebCore { @@ -35,7 +35,7 @@ private: CCResourceProvider* m_resourceProvider; #if !ASSERT_DISABLED - ThreadIdentifier m_allocateThreadIdentifier; + base::PlatformThreadId m_allocateThreadIdentifier; #endif }; diff --git a/cc/CCScopedThreadProxy.h b/cc/CCScopedThreadProxy.h index e30587c..32c5b8e 100644 --- a/cc/CCScopedThreadProxy.h +++ b/cc/CCScopedThreadProxy.h @@ -6,6 +6,7 @@ #define CCScopedThreadProxy_h #include "CCThreadTask.h" +#include "base/threading/platform_thread.h" #include <wtf/ThreadSafeRefCounted.h> namespace WebCore { @@ -24,7 +25,7 @@ class CCScopedThreadProxy : public ThreadSafeRefCounted<CCScopedThreadProxy> { public: static PassRefPtr<CCScopedThreadProxy> create(CCThread* targetThread) { - ASSERT(currentThread() == targetThread->threadID()); + ASSERT(base::PlatformThread::CurrentId() == targetThread->threadID()); return adoptRef(new CCScopedThreadProxy(targetThread)); } @@ -38,7 +39,7 @@ public: void shutdown() { - ASSERT(currentThread() == m_targetThread->threadID()); + ASSERT(base::PlatformThread::CurrentId() == m_targetThread->threadID()); ASSERT(!m_shutdown); m_shutdown = true; } @@ -57,7 +58,7 @@ private: deref(); return; } - ASSERT(currentThread() == m_targetThread->threadID()); + ASSERT(base::PlatformThread::CurrentId() == m_targetThread->threadID()); task->performTask(); deref(); } diff --git a/cc/CCThread.h b/cc/CCThread.h index d375932..a20d5e0 100644 --- a/cc/CCThread.h +++ b/cc/CCThread.h @@ -5,8 +5,9 @@ #ifndef CCThread_h #define CCThread_h +#include "base/threading/platform_thread.h" #include <wtf/PassOwnPtr.h> -#include <wtf/Threading.h> +#include <wtf/Noncopyable.h> namespace WebCore { @@ -33,7 +34,7 @@ public: // Executes the task after the specified delay. virtual void postDelayedTask(PassOwnPtr<Task>, long long delayMs) = 0; - virtual WTF::ThreadIdentifier threadID() const = 0; + virtual base::PlatformThreadId threadID() const = 0; }; } diff --git a/cc/test/CCSchedulerTestCommon.h b/cc/test/CCSchedulerTestCommon.h index cb78510..e7bdce7 100644 --- a/cc/test/CCSchedulerTestCommon.h +++ b/cc/test/CCSchedulerTestCommon.h @@ -8,6 +8,7 @@ #include "CCDelayBasedTimeSource.h" #include "CCFrameRateController.h" #include "CCThread.h" +#include "base/threading/platform_thread.h" #include <gtest/gtest.h> #include <wtf/OwnPtr.h> @@ -64,7 +65,7 @@ public: m_pendingTask = task; m_pendingTaskDelay = delay; } - virtual WTF::ThreadIdentifier threadID() const { return 0; } + virtual base::PlatformThreadId threadID() const { return 0; } protected: OwnPtr<Task> m_pendingTask; |