| 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_THREAD_IMPL_H_ | 5 #ifndef CC_BASE_THREAD_IMPL_H_ |
| 6 #define CC_THREAD_IMPL_H_ | 6 #define CC_BASE_THREAD_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| 11 #include "cc/cc_export.h" | 11 #include "cc/base/cc_export.h" |
| 12 #include "cc/thread.h" | 12 #include "cc/base/thread.h" |
| 13 | 13 |
| 14 namespace cc { | 14 namespace cc { |
| 15 | 15 |
| 16 // Implements cc::Thread in terms of base::MessageLoopProxy. | 16 // Implements cc::Thread in terms of base::MessageLoopProxy. |
| 17 class CC_EXPORT ThreadImpl : public Thread { | 17 class CC_EXPORT ThreadImpl : public Thread { |
| 18 public: | 18 public: |
| 19 // Creates a ThreadImpl wrapping the current thread. | 19 // Creates a ThreadImpl wrapping the current thread. |
| 20 static scoped_ptr<cc::Thread> createForCurrentThread(); | 20 static scoped_ptr<cc::Thread> createForCurrentThread(); |
| 21 | 21 |
| 22 // Creates a Thread wrapping a non-current thread. | 22 // Creates a Thread wrapping a non-current thread. |
| 23 static scoped_ptr<cc::Thread> createForDifferentThread(scoped_refptr<base::M
essageLoopProxy> thread); | 23 static scoped_ptr<cc::Thread> createForDifferentThread(scoped_refptr<base::M
essageLoopProxy> thread); |
| 24 | 24 |
| 25 virtual ~ThreadImpl(); | 25 virtual ~ThreadImpl(); |
| 26 | 26 |
| 27 // cc::Thread implementation | 27 // cc::Thread implementation |
| 28 virtual void postTask(base::Closure cb) OVERRIDE; | 28 virtual void postTask(base::Closure cb) OVERRIDE; |
| 29 virtual void postDelayedTask(base::Closure cb, long long delayMs) OVERRIDE; | 29 virtual void postDelayedTask(base::Closure cb, long long delayMs) OVERRIDE; |
| 30 virtual bool belongsToCurrentThread() const OVERRIDE; | 30 virtual bool belongsToCurrentThread() const OVERRIDE; |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 explicit ThreadImpl(scoped_refptr<base::MessageLoopProxy> thread); | 33 explicit ThreadImpl(scoped_refptr<base::MessageLoopProxy> thread); |
| 34 | 34 |
| 35 scoped_refptr<base::MessageLoopProxy> m_thread; | 35 scoped_refptr<base::MessageLoopProxy> m_thread; |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 } // namespace cc | 38 } // namespace cc |
| 39 | 39 |
| 40 #endif // CC_THREAD_IMPL_H_ | 40 #endif // CC_BASE_THREAD_IMPL_H_ |
| OLD | NEW |