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

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

Issue 1854723002: cc: Simplify task and its derived classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/dependency_task.h"
6
7 namespace cc {
8
9 DependencyTask::DependencyTask()
10 : will_run_(false),
11 did_run_(false),
12 did_schedule_(false),
13 did_complete_(false) {}
14
15 DependencyTask::DependencyTask(DependencyTask::Vector* dependencies)
16 : will_run_(false),
17 did_run_(false),
18 did_schedule_(false),
19 did_complete_(false) {
20 dependencies_.swap(*dependencies);
ericrk 2016/04/01 21:34:30 Rather than having them pass in a non-const * and
prashant.n 2016/04/01 23:48:05 Okay, I'll check apply this modification.
21 }
22
23 DependencyTask::~DependencyTask() {
24 DCHECK(!will_run_);
25 DCHECK(!did_schedule_);
26 DCHECK(!did_run_ || did_complete_);
27 }
28
29 void DependencyTask::WillRun() {
30 DCHECK(!will_run_);
31 DCHECK(!did_run_);
32 will_run_ = true;
33 }
34
35 void DependencyTask::DidRun() {
36 DCHECK(will_run_);
37 will_run_ = false;
38 did_run_ = true;
39 }
40
41 bool DependencyTask::HasFinishedRunning() const {
42 return did_run_;
43 }
44
45 void DependencyTask::WillSchedule() {
46 DCHECK(!did_schedule_);
47 }
48
49 void DependencyTask::DidSchedule() {
50 did_schedule_ = true;
51 did_complete_ = false;
52 }
53
54 bool DependencyTask::HasBeenScheduled() const {
55 return did_schedule_;
56 }
57
58 void DependencyTask::WillComplete() {
59 DCHECK(!did_complete_);
60 }
61
62 void DependencyTask::DidComplete() {
63 DCHECK(did_schedule_);
64 DCHECK(!did_complete_);
65 did_schedule_ = false;
66 did_complete_ = true;
67 }
68
69 bool DependencyTask::HasCompleted() const {
70 return did_complete_;
71 }
72
73 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698