OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "cc/raster/task.h" | 5 #include "cc/raster/task.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace cc { | 9 namespace cc { |
10 | 10 |
11 TaskState::TaskState() : value_(Value::NEW) {} | 11 TaskState::TaskState() : value_(Value::NEW) {} |
12 | 12 |
13 TaskState::~TaskState() { | 13 TaskState::~TaskState() { |
14 DCHECK(value_ != Value::RUNNING) | 14 DCHECK(value_ != Value::RUNNING) |
15 << "Running task should never get destroyed."; | 15 << "Running task should never get destroyed."; |
16 // TODO(prashant.n): Remove NEW, once all the tests follow the task life | 16 DCHECK(value_ == Value::FINISHED || value_ == Value::CANCELED) |
17 // cycle correctly. Few tests still do not take care of task states. | |
18 // crbug.com/613814. | |
19 DCHECK(value_ == Value::NEW || value_ == Value::FINISHED || | |
20 value_ == Value::CANCELED) | |
21 << "Task, if scheduled, should get concluded either in FINISHED or " | 17 << "Task, if scheduled, should get concluded either in FINISHED or " |
22 "CANCELED state."; | 18 "CANCELED state."; |
23 } | 19 } |
24 | 20 |
25 bool TaskState::IsScheduled() const { | 21 bool TaskState::IsScheduled() const { |
26 return value_ == Value::SCHEDULED; | 22 return value_ == Value::SCHEDULED; |
27 } | 23 } |
28 | 24 |
29 bool TaskState::IsRunning() const { | 25 bool TaskState::IsRunning() const { |
30 return value_ == Value::RUNNING; | 26 return value_ == Value::RUNNING; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 nodes.swap(other->nodes); | 77 nodes.swap(other->nodes); |
82 edges.swap(other->edges); | 78 edges.swap(other->edges); |
83 } | 79 } |
84 | 80 |
85 void TaskGraph::Reset() { | 81 void TaskGraph::Reset() { |
86 nodes.clear(); | 82 nodes.clear(); |
87 edges.clear(); | 83 edges.clear(); |
88 } | 84 } |
89 | 85 |
90 } // namespace cc | 86 } // namespace cc |
OLD | NEW |