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