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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "base/threading/platform_thread.h" | 6 #include "base/threading/platform_thread.h" |
7 #include "cc/thread.h" | 7 #include "cc/thread.h" |
8 #include <wtf/OwnPtr.h> | 8 #include <wtf/OwnPtr.h> |
9 #include <wtf/PassOwnPtr.h> | 9 #include <wtf/PassOwnPtr.h> |
10 | 10 |
11 #ifndef CCThreadImpl_h | 11 #ifndef CCThreadImpl_h |
12 #define CCThreadImpl_h | 12 #define CCThreadImpl_h |
13 | 13 |
14 namespace WebKit { | 14 namespace WebKit { |
15 | 15 |
16 class WebThread; | 16 class WebThread; |
17 | 17 |
18 // Implements CCThread in terms of WebThread. | 18 // Implements Thread in terms of WebThread. |
19 class CCThreadImpl : public cc::CCThread { | 19 class CCThreadImpl : public cc::Thread { |
20 public: | 20 public: |
21 // Creates a CCThreadImpl wrapping the current thread. | 21 // Creates a CCThreadImpl wrapping the current thread. |
22 static scoped_ptr<cc::CCThread> createForCurrentThread(); | 22 static scoped_ptr<cc::Thread> createForCurrentThread(); |
23 | 23 |
24 // Creates a CCThread wrapping a non-current WebThread. | 24 // Creates a Thread wrapping a non-current WebThread. |
25 static scoped_ptr<cc::CCThread> createForDifferentThread(WebThread*); | 25 static scoped_ptr<cc::Thread> createForDifferentThread(WebThread*); |
26 | 26 |
27 virtual ~CCThreadImpl(); | 27 virtual ~CCThreadImpl(); |
28 virtual void postTask(PassOwnPtr<cc::CCThread::Task>); | 28 virtual void postTask(PassOwnPtr<cc::Thread::Task>); |
29 virtual void postDelayedTask(PassOwnPtr<cc::CCThread::Task>, long long delay
Ms); | 29 virtual void postDelayedTask(PassOwnPtr<cc::Thread::Task>, long long delayMs
); |
30 base::PlatformThreadId threadID() const; | 30 base::PlatformThreadId threadID() const; |
31 | 31 |
32 private: | 32 private: |
33 CCThreadImpl(WebThread*, bool currentThread); | 33 CCThreadImpl(WebThread*, bool currentThread); |
34 | 34 |
35 WebThread* m_thread; | 35 WebThread* m_thread; |
36 base::PlatformThreadId m_threadID; | 36 base::PlatformThreadId m_threadID; |
37 }; | 37 }; |
38 | 38 |
39 } // namespace WebKit | 39 } // namespace WebKit |
40 | 40 |
41 #endif | 41 #endif |
OLD | NEW |