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

Side by Side Diff: cc/raster/task.cc

Issue 2003333002: cc: Task should complete as finished or canceled in tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@test_task_runner
Patch Set: Created 4 years, 7 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
« no previous file with comments | « cc/raster/raster_buffer_provider_perftest.cc ('k') | cc/raster/task_graph_runner_perftest.cc » ('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 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
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
OLDNEW
« no previous file with comments | « cc/raster/raster_buffer_provider_perftest.cc ('k') | cc/raster/task_graph_runner_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698