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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 1312123005: cc: Fix use-after-free in test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 5 years, 4 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 | « no previous file | tools/valgrind/gtest_exclude/cc_unittests.gtest-drmemory_win32.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index b2c10efb0a08f0877521b59f85cb20e1c562bc93..0c90a5af6de7ccc8f3a2713e287b248c46eeb36f 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -2024,6 +2024,10 @@ class LayerTreeHostTestAbortedCommitDoesntStallSynchronousCompositor
}
void ScheduledActionInvalidateOutputSurface() override {
+ // Do not call ImplThreadTaskRunner after the test ended because of the
+ // possibility of use-after-free due to a race.
+ if (TestEnded())
+ return;
ImplThreadTaskRunner()->PostTask(
FROM_HERE,
base::Bind(
« no previous file with comments | « no previous file | tools/valgrind/gtest_exclude/cc_unittests.gtest-drmemory_win32.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698