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

Side by Side Diff: cc/thread.h

Issue 11344004: Remove WebKit::Platform dependencies from cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix webkit_compositor_bindings_unittests Created 8 years, 1 month 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/texture_layer_unittest.cc ('k') | cc/thread_impl.h » ('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 #ifndef CCThread_h 5 #ifndef CCThread_h
6 #define CCThread_h 6 #define CCThread_h
7 7
8 #include "base/callback.h"
8 #include "base/basictypes.h" 9 #include "base/basictypes.h"
9 #include "base/threading/platform_thread.h"
10 #include <wtf/PassOwnPtr.h>
11 10
12 namespace cc { 11 namespace cc {
13 12
14 // Thread provides basic infrastructure for messaging with the compositor in a 13 // Thread provides basic infrastructure for messaging with the compositor in a
15 // platform-neutral way. 14 // platform-neutral way.
16 class Thread { 15 class Thread {
17 public: 16 public:
18 virtual ~Thread() { } 17 virtual ~Thread() { }
19 18
20 class Task { 19 // Executes the callback on context's thread asynchronously.
21 public: 20 virtual void postTask(base::Closure cb) = 0;
22 virtual ~Task() { }
23 virtual void performTask() = 0;
24 void* instance() const { return m_instance; }
25 protected:
26 Task(void* instance) : m_instance(instance) { }
27 void* m_instance;
28 private:
29 DISALLOW_COPY_AND_ASSIGN(Task);
30 };
31
32 // Executes the task on context's thread asynchronously.
33 virtual void postTask(PassOwnPtr<Task>) = 0;
34 21
35 // Executes the task after the specified delay. 22 // Executes the task after the specified delay.
36 virtual void postDelayedTask(PassOwnPtr<Task>, long long delayMs) = 0; 23 virtual void postDelayedTask(base::Closure cb, long long delayMs) = 0;
37 24
38 virtual base::PlatformThreadId threadID() const = 0; 25 virtual bool belongsToCurrentThread() const = 0;
39 }; 26 };
40 27
41 } 28 }
42 29
43 #endif 30 #endif
OLDNEW
« no previous file with comments | « cc/texture_layer_unittest.cc ('k') | cc/thread_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698