Chromium Code Reviews| Index: cc/raster/task_graph_runner.cc |
| diff --git a/cc/raster/task_graph_runner.cc b/cc/raster/task_graph_runner.cc |
| index 4f1af43ad43901309131886aa2dd6d5c6de1343a..f3d657d279e928b00d3283c6be760f9a7ddf2698 100644 |
| --- a/cc/raster/task_graph_runner.cc |
| +++ b/cc/raster/task_graph_runner.cc |
| @@ -5,6 +5,7 @@ |
| #include "cc/raster/task_graph_runner.h" |
| #include <algorithm> |
| +#include <iomanip> |
|
prashant.n
2016/03/11 17:49:35
Remove.
|
| #include <utility> |
| #include "base/atomic_sequence_num.h" |
| @@ -13,12 +14,23 @@ |
| namespace cc { |
| -Task::Task() : will_run_(false), did_run_(false) {} |
| +Task::Task() : worker_(nullptr), will_run_(false), did_run_(false) {} |
| Task::~Task() { |
| DCHECK(!will_run_); |
| } |
| +void Task::AttachWorker(TaskWorker* worker) { |
|
prashant.n
2016/03/11 17:49:35
AttachTaskWorker/DetachTaskWorker
|
| + DCHECK(!will_run_); |
| + DCHECK(!did_run_); |
| + worker_ = worker; |
| +} |
| +void Task::DetachWorker() { |
| + DCHECK(did_run_); |
| + worker_->TaskDone(); |
| + worker_ = nullptr; |
| +} |
| + |
| void Task::WillRun() { |
| DCHECK(!will_run_); |
| DCHECK(!did_run_); |