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

Unified Diff: cc/test/fake_tile_task_manager.cc

Issue 1866043006: cc: Remove ScheduleOnOriginThread() and CompleteOnOriginThread(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/fake_tile_task_manager.h ('k') | cc/test/task_graph_runner_test_template.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_tile_task_manager.cc
diff --git a/cc/test/fake_tile_task_manager.cc b/cc/test/fake_tile_task_manager.cc
index 9b28d55067754e971f6854c7ab393f2246a2bf90..a5849eab488d874c598d3fd8906e822c82da5a32 100644
--- a/cc/test/fake_tile_task_manager.cc
+++ b/cc/test/fake_tile_task_manager.cc
@@ -16,29 +16,26 @@ FakeTileTaskManagerImpl::FakeTileTaskManagerImpl(
std::unique_ptr<RasterBufferProvider> raster_buffer_provider)
: raster_buffer_provider_(std::move(raster_buffer_provider)) {}
-FakeTileTaskManagerImpl::~FakeTileTaskManagerImpl() {}
+FakeTileTaskManagerImpl::~FakeTileTaskManagerImpl() {
+ DCHECK_EQ(0u, completed_tasks_.size());
+}
void FakeTileTaskManagerImpl::ScheduleTasks(TaskGraph* graph) {
for (const auto& node : graph->nodes) {
TileTask* task = static_cast<TileTask*>(node.task);
-
- task->WillSchedule();
- task->ScheduleOnOriginThread(raster_buffer_provider_.get());
- task->DidSchedule();
-
+ // Cancel the task and append to |completed_tasks_|.
+ task->state().DidCancel();
completed_tasks_.push_back(task);
}
}
void FakeTileTaskManagerImpl::CheckForCompletedTasks() {
- for (Task::Vector::iterator it = completed_tasks_.begin();
- it != completed_tasks_.end(); ++it) {
- TileTask* task = static_cast<TileTask*>(it->get());
-
- task->WillComplete();
- task->CompleteOnOriginThread(raster_buffer_provider_.get());
- task->DidComplete();
+ for (auto& task : completed_tasks_) {
+ DCHECK(task->state().IsFinished() || task->state().IsCanceled());
+ TileTask* tile_task = static_cast<TileTask*>(task.get());
+ tile_task->OnTaskCompleted();
}
+
completed_tasks_.clear();
}
« no previous file with comments | « cc/test/fake_tile_task_manager.h ('k') | cc/test/task_graph_runner_test_template.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698