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

Side by Side Diff: cc/tiles/tile_task_manager.cc

Issue 2018353005: cc: Fix data race in cc::TaskState::IsFinished. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback Created 4 years, 6 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
« no previous file with comments | « cc/tiles/tile_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/tiles/tile_task_manager.h" 5 #include "cc/tiles/tile_task_manager.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 28 matching lines...) Expand all
39 39
40 void TileTaskManagerImpl::CheckForCompletedTasks() { 40 void TileTaskManagerImpl::CheckForCompletedTasks() {
41 TRACE_EVENT0("cc", "TileTaskManagerImpl::CheckForCompletedTasks"); 41 TRACE_EVENT0("cc", "TileTaskManagerImpl::CheckForCompletedTasks");
42 Task::Vector completed_tasks; 42 Task::Vector completed_tasks;
43 task_graph_runner_->CollectCompletedTasks(namespace_token_, &completed_tasks); 43 task_graph_runner_->CollectCompletedTasks(namespace_token_, &completed_tasks);
44 44
45 for (auto& task : completed_tasks) { 45 for (auto& task : completed_tasks) {
46 DCHECK(task->state().IsFinished() || task->state().IsCanceled()); 46 DCHECK(task->state().IsFinished() || task->state().IsCanceled());
47 TileTask* tile_task = static_cast<TileTask*>(task.get()); 47 TileTask* tile_task = static_cast<TileTask*>(task.get());
48 tile_task->OnTaskCompleted(); 48 tile_task->OnTaskCompleted();
49 tile_task->DidComplete();
49 } 50 }
50 } 51 }
51 52
52 void TileTaskManagerImpl::Shutdown() { 53 void TileTaskManagerImpl::Shutdown() {
53 TRACE_EVENT0("cc", "TileTaskManagerImpl::Shutdown"); 54 TRACE_EVENT0("cc", "TileTaskManagerImpl::Shutdown");
54 55
55 // Cancel non-scheduled tasks and wait for running tasks to finish. 56 // Cancel non-scheduled tasks and wait for running tasks to finish.
56 TaskGraph empty; 57 TaskGraph empty;
57 task_graph_runner_->ScheduleTasks(namespace_token_, &empty); 58 task_graph_runner_->ScheduleTasks(namespace_token_, &empty);
58 task_graph_runner_->WaitForTasksToFinishRunning(namespace_token_); 59 task_graph_runner_->WaitForTasksToFinishRunning(namespace_token_);
59 60
60 raster_buffer_provider_->Shutdown(); 61 raster_buffer_provider_->Shutdown();
61 } 62 }
62 63
63 RasterBufferProvider* TileTaskManagerImpl::GetRasterBufferProvider() const { 64 RasterBufferProvider* TileTaskManagerImpl::GetRasterBufferProvider() const {
64 return raster_buffer_provider_.get(); 65 return raster_buffer_provider_.get();
65 } 66 }
66 67
67 } // namespace cc 68 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tiles/tile_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698