Index: cc/thread_impl.h |
diff --git a/cc/thread_impl.h b/cc/thread_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9dfcd8810aae1cfaecf7205d1b8087ddd543bfdf |
--- /dev/null |
+++ b/cc/thread_impl.h |
@@ -0,0 +1,39 @@ |
+// Copyright 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CC_THREAD_IMPL_H_ |
+#define CC_THREAD_IMPL_H_ |
+ |
+#include "base/callback.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "base/message_loop_proxy.h" |
+#include "cc/thread.h" |
+ |
+namespace cc { |
+ |
+// Implements cc::Thread in terms of base::MessageLoopProxy. |
+class ThreadImpl : public Thread { |
+public: |
+ // Creates a ThreadImpl wrapping the current thread. |
+ static scoped_ptr<cc::Thread> createForCurrentThread(); |
+ |
+ // Creates a Thread wrapping a non-current thread. |
+ static scoped_ptr<cc::Thread> createForDifferentThread(scoped_refptr<base::MessageLoopProxy> thread); |
+ |
+ virtual ~ThreadImpl(); |
+ |
+ // cc::Thread implementation |
+ virtual void postTask(base::Closure cb) OVERRIDE; |
+ virtual void postDelayedTask(base::Closure cb, long long delayMs) OVERRIDE; |
+ virtual bool belongsToCurrentThread() const OVERRIDE; |
+ |
+private: |
+ explicit ThreadImpl(scoped_refptr<base::MessageLoopProxy> thread); |
+ |
+ scoped_refptr<base::MessageLoopProxy> m_thread; |
+}; |
+ |
+} // namespace cc |
+ |
+#endif // CC_THREAD_IMPL_H_ |