Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Side by Side Diff: webkit/compositor_bindings/CCThreadImpl.h

Issue 10913158: Avoid using WTF threading code in cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/test/CCSchedulerTestCommon.h ('k') | webkit/compositor_bindings/CCThreadImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "CCThread.h" 5 #include "CCThread.h"
6 #include "base/threading/platform_thread.h"
6 #include <wtf/OwnPtr.h> 7 #include <wtf/OwnPtr.h>
7 #include <wtf/Threading.h> 8 #include <wtf/Threading.h>
8 9
9 #ifndef CCThreadImpl_h 10 #ifndef CCThreadImpl_h
10 #define CCThreadImpl_h 11 #define CCThreadImpl_h
11 12
12 namespace WebKit { 13 namespace WebKit {
13 14
14 class WebThread; 15 class WebThread;
15 16
16 // Implements CCThread in terms of WebThread. 17 // Implements CCThread in terms of WebThread.
17 class CCThreadImpl : public WebCore::CCThread { 18 class CCThreadImpl : public WebCore::CCThread {
18 public: 19 public:
19 static PassOwnPtr<WebCore::CCThread> create(WebThread*); 20 // Creates a CCThreadImpl wrapping the current thread.
21 static PassOwnPtr<WebCore::CCThread> createForCurrentThread();
22
23 // Creates a CCThread wrapping a non-current WebThread.
24 static PassOwnPtr<WebCore::CCThread> createForDifferentThread(WebThread*);
25
20 virtual ~CCThreadImpl(); 26 virtual ~CCThreadImpl();
21 virtual void postTask(PassOwnPtr<WebCore::CCThread::Task>); 27 virtual void postTask(PassOwnPtr<WebCore::CCThread::Task>);
22 virtual void postDelayedTask(PassOwnPtr<WebCore::CCThread::Task>, long long delayMs); 28 virtual void postDelayedTask(PassOwnPtr<WebCore::CCThread::Task>, long long delayMs);
23 WTF::ThreadIdentifier threadID() const; 29 base::PlatformThreadId threadID() const;
24 30
25 private: 31 private:
26 explicit CCThreadImpl(WebThread*); 32 CCThreadImpl(WebThread*, bool currentThread);
27 33
28 WebThread* m_thread; 34 WebThread* m_thread;
29 WTF::ThreadIdentifier m_threadID; 35 base::PlatformThreadId m_threadID;
30 }; 36 };
31 37
32 } // namespace WebKit 38 } // namespace WebKit
33 39
34 #endif 40 #endif
OLDNEW
« no previous file with comments | « cc/test/CCSchedulerTestCommon.h ('k') | webkit/compositor_bindings/CCThreadImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698