| Index: cc/trees/single_thread_proxy.h
|
| diff --git a/cc/trees/single_thread_proxy.h b/cc/trees/single_thread_proxy.h
|
| index c513964f7742454c22950222098c19cc69e7b76c..b5e6691a9bb8cb5194ff9ebe59a47d523ec50b31 100644
|
| --- a/cc/trees/single_thread_proxy.h
|
| +++ b/cc/trees/single_thread_proxy.h
|
| @@ -175,13 +175,16 @@ class CC_EXPORT SingleThreadProxy : public Proxy,
|
| // code is running on the impl thread to satisfy assertion checks.
|
| class DebugScopedSetImplThread {
|
| public:
|
| +#if DCHECK_IS_ON()
|
| explicit DebugScopedSetImplThread(TaskRunnerProvider* task_runner_provider)
|
| : task_runner_provider_(task_runner_provider) {
|
| -#if DCHECK_IS_ON()
|
| previous_value_ = task_runner_provider_->impl_thread_is_overridden_;
|
| task_runner_provider_->SetCurrentThreadIsImplThread(true);
|
| -#endif
|
| }
|
| +#else
|
| + explicit DebugScopedSetImplThread(TaskRunnerProvider* task_runner_provider) {}
|
| +#endif
|
| +
|
| ~DebugScopedSetImplThread() {
|
| #if DCHECK_IS_ON()
|
| task_runner_provider_->SetCurrentThreadIsImplThread(previous_value_);
|
| @@ -189,8 +192,10 @@ class DebugScopedSetImplThread {
|
| }
|
|
|
| private:
|
| +#if DCHECK_IS_ON()
|
| bool previous_value_;
|
| TaskRunnerProvider* task_runner_provider_;
|
| +#endif
|
|
|
| DISALLOW_COPY_AND_ASSIGN(DebugScopedSetImplThread);
|
| };
|
| @@ -199,13 +204,16 @@ class DebugScopedSetImplThread {
|
| // code is running on the main thread to satisfy assertion checks.
|
| class DebugScopedSetMainThread {
|
| public:
|
| +#if DCHECK_IS_ON()
|
| explicit DebugScopedSetMainThread(TaskRunnerProvider* task_runner_provider)
|
| : task_runner_provider_(task_runner_provider) {
|
| -#if DCHECK_IS_ON()
|
| previous_value_ = task_runner_provider_->impl_thread_is_overridden_;
|
| task_runner_provider_->SetCurrentThreadIsImplThread(false);
|
| -#endif
|
| }
|
| +#else
|
| + explicit DebugScopedSetMainThread(TaskRunnerProvider* task_runner_provider) {}
|
| +#endif
|
| +
|
| ~DebugScopedSetMainThread() {
|
| #if DCHECK_IS_ON()
|
| task_runner_provider_->SetCurrentThreadIsImplThread(previous_value_);
|
| @@ -213,8 +221,10 @@ class DebugScopedSetMainThread {
|
| }
|
|
|
| private:
|
| +#if DCHECK_IS_ON()
|
| bool previous_value_;
|
| TaskRunnerProvider* task_runner_provider_;
|
| +#endif
|
|
|
| DISALLOW_COPY_AND_ASSIGN(DebugScopedSetMainThread);
|
| };
|
|
|