OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RASTER_TASK_GRAPH_RUNNER_H_ | 5 #ifndef CC_RASTER_TASK_GRAPH_RUNNER_H_ |
6 #define CC_RASTER_TASK_GRAPH_RUNNER_H_ | 6 #define CC_RASTER_TASK_GRAPH_RUNNER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 // Subclasses should implement this method. RunOnWorkerThread may be called | 31 // Subclasses should implement this method. RunOnWorkerThread may be called |
32 // on any thread, and subclasses are responsible for locking and thread | 32 // on any thread, and subclasses are responsible for locking and thread |
33 // safety. | 33 // safety. |
34 virtual void RunOnWorkerThread() = 0; | 34 virtual void RunOnWorkerThread() = 0; |
35 | 35 |
36 void WillRun(); | 36 void WillRun(); |
37 void DidRun(); | 37 void DidRun(); |
38 bool HasFinishedRunning() const; | 38 bool HasFinishedRunning() const; |
39 | 39 |
| 40 bool cancelled; |
| 41 |
40 protected: | 42 protected: |
41 friend class base::RefCountedThreadSafe<Task>; | 43 friend class base::RefCountedThreadSafe<Task>; |
42 | 44 |
43 Task(); | 45 Task(); |
44 virtual ~Task(); | 46 virtual ~Task(); |
45 | 47 |
46 bool will_run_; | 48 bool will_run_; |
47 bool did_run_; | 49 bool did_run_; |
48 }; | 50 }; |
49 | 51 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 private: | 219 private: |
218 TaskGraph* graph_; | 220 TaskGraph* graph_; |
219 const Task* task_; | 221 const Task* task_; |
220 size_t current_index_; | 222 size_t current_index_; |
221 TaskGraph::Node* current_node_; | 223 TaskGraph::Node* current_node_; |
222 }; | 224 }; |
223 | 225 |
224 } // namespace cc | 226 } // namespace cc |
225 | 227 |
226 #endif // CC_RASTER_TASK_GRAPH_RUNNER_H_ | 228 #endif // CC_RASTER_TASK_GRAPH_RUNNER_H_ |
OLD | NEW |