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

Side by Side Diff: cc/base/thread.h

Issue 17362002: cc: Remove FakeThread, use SingleThreadTaskRunner in scheduling classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rm-fakethread: rebase Created 7 years, 6 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 | « base/test/test_simple_task_runner.cc ('k') | cc/base/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 CC_BASE_THREAD_H_ 5 #ifndef CC_BASE_THREAD_H_
6 #define CC_BASE_THREAD_H_ 6 #define CC_BASE_THREAD_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/time.h" 10 #include "base/time.h"
11 #include "cc/base/cc_export.h" 11 #include "cc/base/cc_export.h"
12 12
13 namespace base { class SingleThreadTaskRunner; }
14
13 namespace cc { 15 namespace cc {
14 16
15 // Thread provides basic infrastructure for messaging with the compositor in a 17 // Thread provides basic infrastructure for messaging with the compositor in a
16 // platform-neutral way. 18 // platform-neutral way.
17 class CC_EXPORT Thread { 19 class CC_EXPORT Thread {
18 public: 20 public:
19 virtual ~Thread() {} 21 virtual ~Thread() {}
20 22
21 // Executes the callback on context's thread asynchronously. 23 // Executes the callback on context's thread asynchronously.
22 virtual void PostTask(base::Closure cb) = 0; 24 virtual void PostTask(base::Closure cb) = 0;
23 25
24 // Executes the task after the specified delay. 26 // Executes the task after the specified delay.
25 virtual void PostDelayedTask(base::Closure cb, base::TimeDelta delay) = 0; 27 virtual void PostDelayedTask(base::Closure cb, base::TimeDelta delay) = 0;
26 28
27 virtual bool BelongsToCurrentThread() const = 0; 29 virtual bool BelongsToCurrentThread() const = 0;
30
31 virtual base::SingleThreadTaskRunner* TaskRunner() = 0;
28 }; 32 };
29 33
30 } // namespace cc 34 } // namespace cc
31 35
32 #endif // CC_BASE_THREAD_H_ 36 #endif // CC_BASE_THREAD_H_
OLDNEW
« no previous file with comments | « base/test/test_simple_task_runner.cc ('k') | cc/base/thread_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698