diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-30 22:59:56 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-30 22:59:56 +0000 |
commit | e5e9c02081e6b37f49febeba87863a1dac598949 (patch) | |
tree | 3e2c4fcd2926cc064fd7937e3cdee49e9ef62fd6 /cc/proxy.cc | |
parent | 760d9886b9d56182f6c91944e06f250df6677d33 (diff) | |
download | chromium_src-e5e9c02081e6b37f49febeba87863a1dac598949.zip chromium_src-e5e9c02081e6b37f49febeba87863a1dac598949.tar.gz chromium_src-e5e9c02081e6b37f49febeba87863a1dac598949.tar.bz2 |
Remove WebKit::Platform dependencies from cc
This removes all dependencies on the static WebKit::Platform pointer from cc.
The biggest change is implementing cc::Thread on top of base::MessageLoopProxy
instead of WebKit::WebThread. For the main thread cc::Thread simply binds to
the current thread's MessageLoopProxy. For the impl thread, the bindings layer
(specifically webkit/compositor_bindings/web_compositor_impl) extracts the
MessageLoopProxy out of the passed in WebThread.
BUG=144539
Review URL: https://codereview.chromium.org/11344004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165050 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/proxy.cc')
-rw-r--r-- | cc/proxy.cc | 19 |
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 |