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

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

Issue 1854723002: cc: Simplify task and its derived classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Corrected scope of dependencies. Created 4 years, 8 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "cc/raster/task.h"
6
7 #include "base/logging.h"
8
9 namespace cc {
10
11 Task::Task()
12 : did_schedule_(false),
13 did_complete_(false),
14 will_run_(false),
15 did_run_(false) {}
16
17 Task::~Task() {
18 DCHECK(!did_schedule_);
19 DCHECK(!will_run_);
20 DCHECK(!did_run_ || did_complete_);
21 }
22
23 void Task::WillRun() {
24 DCHECK(!will_run_);
25 DCHECK(!did_run_);
26 will_run_ = true;
27 }
28
29 void Task::DidRun() {
30 DCHECK(will_run_);
31 will_run_ = false;
32 did_run_ = true;
33 }
34
35 bool Task::HasFinishedRunning() const {
36 return did_run_;
37 }
38
39 void Task::WillSchedule() {
40 DCHECK(!did_schedule_);
41 }
42
43 void Task::DidSchedule() {
44 did_schedule_ = true;
45 did_complete_ = false;
46 }
47
48 bool Task::HasBeenScheduled() const {
49 return did_schedule_;
50 }
51
52 void Task::WillComplete() {
53 DCHECK(!did_complete_);
54 }
55
56 void Task::DidComplete() {
57 DCHECK(did_schedule_);
58 DCHECK(!did_complete_);
59 did_schedule_ = false;
60 did_complete_ = true;
61 }
62
63 bool Task::HasCompleted() const {
64 return did_complete_;
65 }
66
67 } // namespace cc
OLDNEW
« no previous file with comments | « cc/raster/task.h ('k') | cc/raster/task_graph_runner.h » ('j') | cc/tiles/tile_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698