Skip to content

Commit

Permalink
Remove no longer needed TileManager task references
Browse files Browse the repository at this point in the history
With crrev.com/2349543003, TaskGraph::Task owns tasks, keeping them
alive while the graph is running. This means that TileManager no longer
needs to keep these tasks alive while the graph may still be using
them. Clean up these references.

R=vmpstr
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Review-Url: https://codereview.chromium.org/2534283002
Cr-Commit-Position: refs/heads/master@{#435454}
  • Loading branch information
ericrk authored and Commit bot committed Nov 30, 2016
1 parent 619252a commit 005de7e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
15 changes: 0 additions & 15 deletions cc/tiles/tile_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,6 @@ void TileManager::FinishTasksAndCleanUp() {

tile_task_manager_->CheckForCompletedTasks();

// Now that all tasks have been finished, we can clear any |orphan_tasks_|.
orphan_tasks_.clear();

FreeResourcesForReleasedTiles();
CleanUpReleasedTiles();

Expand Down Expand Up @@ -949,17 +946,6 @@ void TileManager::ScheduleTasks(
// in |raster_queue_|.
tile_task_manager_->ScheduleTasks(&graph_);

// It's now safe to clean up orphan tasks as raster worker pool is not
// allowed to keep around unreferenced raster tasks after ScheduleTasks() has
// been called.
orphan_tasks_.clear();

// It's also now safe to replace our *_done_task_ tasks.
required_for_activation_done_task_ =
std::move(required_for_activation_done_task);
required_for_draw_done_task_ = std::move(required_for_draw_done_task);
all_done_task_ = std::move(all_done_task);

did_check_for_completed_tasks_since_last_schedule_tasks_ = false;

TRACE_EVENT_ASYNC_STEP_INTO1("cc", "ScheduledTasks", this, "running", "state",
Expand Down Expand Up @@ -1033,7 +1019,6 @@ void TileManager::OnRasterTaskCompleted(

TileDrawInfo& draw_info = tile->draw_info();
DCHECK(tile->raster_task_.get());
orphan_tasks_.push_back(tile->raster_task_);
tile->raster_task_ = nullptr;

// Unref all the images.
Expand Down
5 changes: 0 additions & 5 deletions cc/tiles/tile_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,7 @@ class CC_EXPORT TileManager {

std::vector<Tile*> released_tiles_;

std::vector<scoped_refptr<TileTask>> orphan_tasks_;

TaskGraph graph_;
scoped_refptr<TileTask> required_for_activation_done_task_;
scoped_refptr<TileTask> required_for_draw_done_task_;
scoped_refptr<TileTask> all_done_task_;

UniqueNotifier more_tiles_need_prepare_check_notifier_;

Expand Down

0 comments on commit 005de7e

Please sign in to comment.