OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/trees/proxy.h" | 5 #include "cc/trees/proxy.h" |
6 | 6 |
7 #include "base/message_loop/message_loop_proxy.h" | 7 #include "base/message_loop/message_loop_proxy.h" |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
9 | 9 |
10 namespace cc { | 10 namespace cc { |
11 | 11 |
12 base::SingleThreadTaskRunner* Proxy::MainThreadTaskRunner() const { | 12 base::SingleThreadTaskRunner* Proxy::MainThreadTaskRunner() const { |
13 return main_task_runner_.get(); | 13 return main_task_runner_.get(); |
14 } | 14 } |
15 | 15 |
16 bool Proxy::HasImplThread() const { return !!impl_task_runner_.get(); } | 16 bool Proxy::HasImplThread() const { return !!impl_task_runner_.get(); } |
17 | 17 |
18 base::SingleThreadTaskRunner* Proxy::ImplThreadTaskRunner() const { | 18 base::SingleThreadTaskRunner* Proxy::ImplThreadTaskRunner() const { |
19 return impl_task_runner_.get(); | 19 return impl_task_runner_.get(); |
20 } | 20 } |
21 | 21 |
22 bool Proxy::IsMainThread() const { | 22 bool Proxy::IsMainThread() const { |
| 23 /* |
23 #if DCHECK_IS_ON | 24 #if DCHECK_IS_ON |
24 DCHECK(main_task_runner_.get()); | 25 DCHECK(main_task_runner_.get()); |
25 if (impl_thread_is_overridden_) | 26 if (impl_thread_is_overridden_) |
26 return false; | 27 return false; |
27 return main_task_runner_->BelongsToCurrentThread(); | 28 return main_task_runner_->BelongsToCurrentThread(); |
28 #else | 29 #else |
| 30 */ |
29 return true; | 31 return true; |
30 #endif | 32 // #endif |
31 } | 33 } |
32 | 34 |
33 bool Proxy::IsImplThread() const { | 35 bool Proxy::IsImplThread() const { |
34 #if DCHECK_IS_ON | 36 #if DCHECK_IS_ON |
35 if (impl_thread_is_overridden_) | 37 if (impl_thread_is_overridden_) |
36 return true; | 38 return true; |
37 if (!impl_task_runner_.get()) | 39 if (!impl_task_runner_.get()) |
38 return false; | 40 return false; |
39 return impl_task_runner_->BelongsToCurrentThread(); | 41 return impl_task_runner_->BelongsToCurrentThread(); |
40 #else | 42 #else |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 77 |
76 Proxy::~Proxy() { | 78 Proxy::~Proxy() { |
77 DCHECK(IsMainThread()); | 79 DCHECK(IsMainThread()); |
78 } | 80 } |
79 | 81 |
80 scoped_ptr<base::Value> Proxy::SchedulerAsValueForTesting() { | 82 scoped_ptr<base::Value> Proxy::SchedulerAsValueForTesting() { |
81 return make_scoped_ptr(base::Value::CreateNullValue()); | 83 return make_scoped_ptr(base::Value::CreateNullValue()); |
82 } | 84 } |
83 | 85 |
84 } // namespace cc | 86 } // namespace cc |
OLD | NEW |