| Index: cc/trees/thread_verifier.cc
|
| diff --git a/cc/trees/proxy.cc b/cc/trees/thread_verifier.cc
|
| similarity index 69%
|
| copy from cc/trees/proxy.cc
|
| copy to cc/trees/thread_verifier.cc
|
| index 58d10b910cbdd2ce1aa8fb10a3cdc3af04531a3a..a689ecb447e2bbab72f4705ad3a762e814e81c38 100644
|
| --- a/cc/trees/proxy.cc
|
| +++ b/cc/trees/thread_verifier.cc
|
| @@ -2,24 +2,25 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "cc/trees/proxy.h"
|
| -
|
| +#include "cc/trees/thread_verifier.h"
|
| #include "base/single_thread_task_runner.h"
|
| #include "cc/trees/blocking_task_runner.h"
|
|
|
| namespace cc {
|
|
|
| -base::SingleThreadTaskRunner* Proxy::MainThreadTaskRunner() const {
|
| +base::SingleThreadTaskRunner* ThreadVerifier::MainThreadTaskRunner() const {
|
| return main_task_runner_.get();
|
| }
|
|
|
| -bool Proxy::HasImplThread() const { return !!impl_task_runner_.get(); }
|
| +bool ThreadVerifier::HasImplThread() const {
|
| + return !!impl_task_runner_.get();
|
| +}
|
|
|
| -base::SingleThreadTaskRunner* Proxy::ImplThreadTaskRunner() const {
|
| +base::SingleThreadTaskRunner* ThreadVerifier::ImplThreadTaskRunner() const {
|
| return impl_task_runner_.get();
|
| }
|
|
|
| -bool Proxy::IsMainThread() const {
|
| +bool ThreadVerifier::IsMainThread() const {
|
| #if DCHECK_IS_ON()
|
| if (impl_thread_is_overridden_)
|
| return false;
|
| @@ -34,7 +35,7 @@ bool Proxy::IsMainThread() const {
|
| #endif
|
| }
|
|
|
| -bool Proxy::IsImplThread() const {
|
| +bool ThreadVerifier::IsImplThread() const {
|
| #if DCHECK_IS_ON()
|
| if (impl_thread_is_overridden_)
|
| return true;
|
| @@ -47,12 +48,12 @@ bool Proxy::IsImplThread() const {
|
| }
|
|
|
| #if DCHECK_IS_ON()
|
| -void Proxy::SetCurrentThreadIsImplThread(bool is_impl_thread) {
|
| +void ThreadVerifier::SetCurrentThreadIsImplThread(bool is_impl_thread) {
|
| impl_thread_is_overridden_ = is_impl_thread;
|
| }
|
| #endif
|
|
|
| -bool Proxy::IsMainThreadBlocked() const {
|
| +bool ThreadVerifier::IsMainThreadBlocked() const {
|
| #if DCHECK_IS_ON()
|
| return is_main_thread_blocked_;
|
| #else
|
| @@ -61,13 +62,14 @@ bool Proxy::IsMainThreadBlocked() const {
|
| }
|
|
|
| #if DCHECK_IS_ON()
|
| -void Proxy::SetMainThreadBlocked(bool is_main_thread_blocked) {
|
| +void ThreadVerifier::SetMainThreadBlocked(bool is_main_thread_blocked) {
|
| is_main_thread_blocked_ = is_main_thread_blocked;
|
| }
|
| #endif
|
|
|
| -Proxy::Proxy(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
|
| - scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner)
|
| +ThreadVerifier::ThreadVerifier(
|
| + scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
|
| + scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner)
|
| #if !DCHECK_IS_ON()
|
| : main_task_runner_(main_task_runner),
|
| impl_task_runner_(impl_task_runner),
|
| @@ -84,7 +86,7 @@ Proxy::Proxy(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
|
| #endif
|
| }
|
|
|
| -Proxy::~Proxy() {
|
| +ThreadVerifier::~ThreadVerifier() {
|
| DCHECK(IsMainThread());
|
| }
|
|
|
|
|