| 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_RESOURCES_TASK_GRAPH_RUNNER_H_ | 5 #ifndef CC_RESOURCES_TASK_GRAPH_RUNNER_H_ |
| 6 #define CC_RESOURCES_TASK_GRAPH_RUNNER_H_ | 6 #define CC_RESOURCES_TASK_GRAPH_RUNNER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/synchronization/condition_variable.h" | 13 #include "base/synchronization/condition_variable.h" |
| 14 #include "cc/base/cc_export.h" | 14 #include "cc/base/cc_export.h" |
| 15 | 15 |
| 16 namespace cc { | 16 namespace cc { |
| 17 | 17 |
| 18 class CC_EXPORT Task : public base::RefCountedThreadSafe<Task> { | 18 class CC_EXPORT Task : public base::RefCountedThreadSafe<Task> { |
| 19 public: | 19 public: |
| 20 typedef std::vector<scoped_refptr<Task> > Vector; | 20 typedef std::vector<scoped_refptr<Task>> Vector; |
| 21 | 21 |
| 22 virtual void RunOnWorkerThread() = 0; | 22 virtual void RunOnWorkerThread() = 0; |
| 23 | 23 |
| 24 void WillRun(); | 24 void WillRun(); |
| 25 void DidRun(); | 25 void DidRun(); |
| 26 bool HasFinishedRunning() const; | 26 bool HasFinishedRunning() const; |
| 27 | 27 |
| 28 protected: | 28 protected: |
| 29 friend class base::RefCountedThreadSafe<Task>; | 29 friend class base::RefCountedThreadSafe<Task>; |
| 30 | 30 |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 223 |
| 224 // Set during shutdown. Tells Run() to return when no more tasks are pending. | 224 // Set during shutdown. Tells Run() to return when no more tasks are pending. |
| 225 bool shutdown_; | 225 bool shutdown_; |
| 226 | 226 |
| 227 DISALLOW_COPY_AND_ASSIGN(TaskGraphRunner); | 227 DISALLOW_COPY_AND_ASSIGN(TaskGraphRunner); |
| 228 }; | 228 }; |
| 229 | 229 |
| 230 } // namespace cc | 230 } // namespace cc |
| 231 | 231 |
| 232 #endif // CC_RESOURCES_TASK_GRAPH_RUNNER_H_ | 232 #endif // CC_RESOURCES_TASK_GRAPH_RUNNER_H_ |
| OLD | NEW |