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

Unified Diff: cc/proxy.cc

Issue 11344004: Remove WebKit::Platform dependencies from cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix webkit_compositor_bindings_unittests 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
« no previous file with comments | « cc/prioritized_texture_unittest.cc ('k') | cc/rate_limiter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « cc/prioritized_texture_unittest.cc ('k') | cc/rate_limiter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698