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

Unified 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, 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/raster/tile_task.h ('k') | cc/test/fake_tile_task_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/raster/tile_task.cc
diff --git a/cc/raster/tile_task.cc b/cc/raster/tile_task.cc
index 87163164cf14ea01d54fc1d509b9c214aa8c11bc..d731433c2c0f25d6ec70d5b16b48bb8563b70a31 100644
--- a/cc/raster/tile_task.cc
+++ b/cc/raster/tile_task.cc
@@ -9,13 +9,26 @@
namespace cc {
TileTask::TileTask(bool supports_concurrent_execution)
- : supports_concurrent_execution_(supports_concurrent_execution) {}
+ : supports_concurrent_execution_(supports_concurrent_execution),
+ did_complete_(false) {}
TileTask::TileTask(bool supports_concurrent_execution,
TileTask::Vector* dependencies)
: supports_concurrent_execution_(supports_concurrent_execution),
- dependencies_(std::move(*dependencies)) {}
+ dependencies_(std::move(*dependencies)),
+ did_complete_(false) {}
+
+TileTask::~TileTask() {
+ DCHECK(did_complete_);
+}
+
+void TileTask::DidComplete() {
+ DCHECK(!did_complete_);
+ did_complete_ = true;
+}
-TileTask::~TileTask() {}
+bool TileTask::HasCompleted() const {
+ return did_complete_;
+}
} // namespace cc
« 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