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

Side by Side Diff: cc/raster/tile_task.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/raster/tile_task.h ('k') | cc/test/fake_tile_task_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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/raster/tile_task.h" 5 #include "cc/raster/tile_task.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace cc { 9 namespace cc {
10 10
11 TileTask::TileTask(bool supports_concurrent_execution) 11 TileTask::TileTask(bool supports_concurrent_execution)
12 : supports_concurrent_execution_(supports_concurrent_execution) {} 12 : supports_concurrent_execution_(supports_concurrent_execution),
13 did_complete_(false) {}
13 14
14 TileTask::TileTask(bool supports_concurrent_execution, 15 TileTask::TileTask(bool supports_concurrent_execution,
15 TileTask::Vector* dependencies) 16 TileTask::Vector* dependencies)
16 : supports_concurrent_execution_(supports_concurrent_execution), 17 : supports_concurrent_execution_(supports_concurrent_execution),
17 dependencies_(std::move(*dependencies)) {} 18 dependencies_(std::move(*dependencies)),
19 did_complete_(false) {}
18 20
19 TileTask::~TileTask() {} 21 TileTask::~TileTask() {
22 DCHECK(did_complete_);
23 }
24
25 void TileTask::DidComplete() {
26 DCHECK(!did_complete_);
27 did_complete_ = true;
28 }
29
30 bool TileTask::HasCompleted() const {
31 return did_complete_;
32 }
20 33
21 } // namespace cc 34 } // namespace cc
OLDNEW
« no previous file with comments | « cc/raster/tile_task.h ('k') | cc/test/fake_tile_task_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698