OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CC_BASE_THREAD_H_ | |
6 #define CC_BASE_THREAD_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/callback.h" | |
10 #include "base/time.h" | |
11 #include "cc/base/cc_export.h" | |
12 | |
13 namespace base { class SingleThreadTaskRunner; } | |
14 | |
15 namespace cc { | |
16 | |
17 // Thread provides basic infrastructure for messaging with the compositor in a | |
18 // platform-neutral way. | |
19 class CC_EXPORT Thread { | |
20 public: | |
21 virtual ~Thread() {} | |
22 | |
23 // Executes the callback on context's thread asynchronously. | |
24 virtual void PostTask(base::Closure cb) = 0; | |
25 | |
26 // Executes the task after the specified delay. | |
27 virtual void PostDelayedTask(base::Closure cb, base::TimeDelta delay) = 0; | |
28 | |
29 virtual bool BelongsToCurrentThread() const = 0; | |
30 | |
31 virtual base::SingleThreadTaskRunner* TaskRunner() = 0; | |
32 }; | |
33 | |
34 } // namespace cc | |
35 | |
36 #endif // CC_BASE_THREAD_H_ | |
OLD | NEW |