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

Side by Side Diff: cc/test/layer_tree_test.h

Issue 2155123003: cc: Fix use-after-frees for LayerTreeHostAnimationTest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test-task-runner-gone: =nullptr Created 4 years, 5 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 | « no previous file | cc/test/layer_tree_test.cc » ('j') | cc/test/layer_tree_test.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 #ifndef CC_TEST_LAYER_TREE_TEST_H_ 5 #ifndef CC_TEST_LAYER_TREE_TEST_H_
6 #define CC_TEST_LAYER_TREE_TEST_H_ 6 #define CC_TEST_LAYER_TREE_TEST_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/threading/thread.h" 9 #include "base/threading/thread.h"
10 #include "cc/animation/animation_delegate.h" 10 #include "cc/animation/animation_delegate.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 virtual void AfterTest() = 0; 122 virtual void AfterTest() = 0;
123 virtual void WillBeginTest(); 123 virtual void WillBeginTest();
124 virtual void BeginTest() = 0; 124 virtual void BeginTest() = 0;
125 virtual void SetupTree(); 125 virtual void SetupTree();
126 126
127 virtual void RunTest(CompositorMode mode, bool delegating_renderer); 127 virtual void RunTest(CompositorMode mode, bool delegating_renderer);
128 128
129 bool HasImplThread() const { return !!impl_thread_; } 129 bool HasImplThread() const { return !!impl_thread_; }
130 base::SingleThreadTaskRunner* ImplThreadTaskRunner() { 130 base::SingleThreadTaskRunner* ImplThreadTaskRunner() {
131 DCHECK(task_runner_provider()); 131 return impl_task_runner_.get();
132 base::SingleThreadTaskRunner* impl_thread_task_runner =
133 task_runner_provider()->ImplThreadTaskRunner();
134 return impl_thread_task_runner ? impl_thread_task_runner
135 : main_task_runner_.get();
136 } 132 }
137 base::SingleThreadTaskRunner* MainThreadTaskRunner() { 133 base::SingleThreadTaskRunner* MainThreadTaskRunner() {
138 return main_task_runner_.get(); 134 return main_task_runner_.get();
139 } 135 }
140 Proxy* proxy() const { 136 Proxy* proxy() const {
141 return layer_tree_host_ ? layer_tree_host_->proxy() : NULL; 137 return layer_tree_host_ ? layer_tree_host_->proxy() : NULL;
142 } 138 }
143 Proxy* remote_client_proxy() const; 139 Proxy* remote_client_proxy() const;
144 TaskRunnerProvider* task_runner_provider() const; 140 TaskRunnerProvider* task_runner_provider() const;
145 TaskGraphRunner* task_graph_runner() const; 141 TaskGraphRunner* task_graph_runner() const;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 bool end_when_begin_returns_; 197 bool end_when_begin_returns_;
202 bool timed_out_; 198 bool timed_out_;
203 bool scheduled_; 199 bool scheduled_;
204 bool started_; 200 bool started_;
205 bool ended_; 201 bool ended_;
206 bool delegating_renderer_; 202 bool delegating_renderer_;
207 203
208 int timeout_seconds_; 204 int timeout_seconds_;
209 205
210 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; 206 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
207 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_;
211 std::unique_ptr<base::Thread> impl_thread_; 208 std::unique_ptr<base::Thread> impl_thread_;
212 std::unique_ptr<SharedBitmapManager> shared_bitmap_manager_; 209 std::unique_ptr<SharedBitmapManager> shared_bitmap_manager_;
213 std::unique_ptr<TestGpuMemoryBufferManager> gpu_memory_buffer_manager_; 210 std::unique_ptr<TestGpuMemoryBufferManager> gpu_memory_buffer_manager_;
214 std::unique_ptr<TestTaskGraphRunner> task_graph_runner_; 211 std::unique_ptr<TestTaskGraphRunner> task_graph_runner_;
215 base::CancelableClosure timeout_; 212 base::CancelableClosure timeout_;
216 scoped_refptr<TestContextProvider> compositor_contexts_; 213 scoped_refptr<TestContextProvider> compositor_contexts_;
217 base::WeakPtr<LayerTreeTest> main_thread_weak_ptr_; 214 base::WeakPtr<LayerTreeTest> main_thread_weak_ptr_;
218 base::WeakPtrFactory<LayerTreeTest> weak_factory_; 215 base::WeakPtrFactory<LayerTreeTest> weak_factory_;
219 }; 216 };
220 217
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ 267 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \
271 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ 268 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \
272 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) 269 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME)
273 270
274 // Some tests want to control when notify ready for activation occurs, 271 // Some tests want to control when notify ready for activation occurs,
275 // but this is not supported in the single-threaded case. 272 // but this is not supported in the single-threaded case.
276 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ 273 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \
277 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) 274 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME)
278 275
279 #endif // CC_TEST_LAYER_TREE_TEST_H_ 276 #endif // CC_TEST_LAYER_TREE_TEST_H_
OLDNEW
« no previous file with comments | « no previous file | cc/test/layer_tree_test.cc » ('j') | cc/test/layer_tree_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698