Enable right clicking on the applist doodle web contents and log the data.
[chromium-blink-merge.git] / cc / resources / tile_task_runner.cc
blob8775d322ce812f9347554509a4cf286b59b114d4
1 // Copyright 2014 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.
5 #include "cc/resources/tile_task_runner.h"
7 #include <algorithm>
9 namespace cc {
11 TileTask::TileTask() : did_schedule_(false), did_complete_(false) {
14 TileTask::~TileTask() {
15 // Debugging CHECKs to help track down a use-after-free.
16 CHECK(!did_schedule_);
17 CHECK(!did_run_ || did_complete_);
20 ImageDecodeTask* TileTask::AsImageDecodeTask() {
21 return NULL;
24 RasterTask* TileTask::AsRasterTask() {
25 return NULL;
28 void TileTask::WillSchedule() {
29 DCHECK(!did_schedule_);
32 void TileTask::DidSchedule() {
33 did_schedule_ = true;
34 did_complete_ = false;
37 bool TileTask::HasBeenScheduled() const {
38 return did_schedule_;
41 void TileTask::WillComplete() {
42 DCHECK(!did_complete_);
45 void TileTask::DidComplete() {
46 DCHECK(did_schedule_);
47 DCHECK(!did_complete_);
48 did_schedule_ = false;
49 did_complete_ = true;
52 bool TileTask::HasCompleted() const {
53 return did_complete_;
56 ImageDecodeTask::ImageDecodeTask() {
59 ImageDecodeTask::~ImageDecodeTask() {
62 ImageDecodeTask* ImageDecodeTask::AsImageDecodeTask() {
63 return this;
66 RasterTask::RasterTask(const Resource* resource,
67 ImageDecodeTask::Vector* dependencies)
68 : resource_(resource) {
69 dependencies_.swap(*dependencies);
72 RasterTask::~RasterTask() {
75 RasterTask* RasterTask::AsRasterTask() {
76 return this;
79 TileTaskQueue::Item::Item(RasterTask* task, const TaskSetCollection& task_sets)
80 : task(task), task_sets(task_sets) {
81 DCHECK(task_sets.any());
84 TileTaskQueue::Item::~Item() {
87 TileTaskQueue::TileTaskQueue() {
90 TileTaskQueue::~TileTaskQueue() {
93 void TileTaskQueue::Swap(TileTaskQueue* other) {
94 items.swap(other->items);
97 void TileTaskQueue::Reset() {
98 items.clear();
101 } // namespace cc