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

Unified Diff: cc/trees/occlusion_tracker_unittest.cc

Issue 609663003: cc: Remove use of PassAs() and constructor-casting with scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cc-passas: PassAs-presubmit-warning Created 6 years, 3 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/trees/occlusion_tracker_perftest.cc ('k') | cc/trees/single_thread_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/occlusion_tracker_unittest.cc
diff --git a/cc/trees/occlusion_tracker_unittest.cc b/cc/trees/occlusion_tracker_unittest.cc
index b35e437bd3a955467c2ffe1ca9df32403470c54c..3c6c4403690d8bd11b0484b05bc5168bdb5af1a0 100644
--- a/cc/trees/occlusion_tracker_unittest.cc
+++ b/cc/trees/occlusion_tracker_unittest.cc
@@ -121,13 +121,8 @@ struct OcclusionTrackerTestMainThreadTypes {
return make_scoped_refptr(new ContentLayerType());
}
- static LayerPtrType PassLayerPtr(ContentLayerPtrType* layer) {
- LayerPtrType ref(*layer);
- *layer = NULL;
- return ref;
- }
-
- static LayerPtrType PassLayerPtr(LayerPtrType* layer) {
+ template <typename T>
+ static LayerPtrType PassLayerPtr(T* layer) {
LayerPtrType ref(*layer);
*layer = NULL;
return ref;
@@ -156,14 +151,11 @@ struct OcclusionTrackerTestImplThreadTypes {
}
static int next_layer_impl_id;
- static LayerPtrType PassLayerPtr(LayerPtrType* layer) {
+ template <typename T>
+ static LayerPtrType PassLayerPtr(T* layer) {
return layer->Pass();
}
- static LayerPtrType PassLayerPtr(ContentLayerPtrType* layer) {
- return layer->PassAs<LayerType>();
- }
-
static void DestroyLayer(LayerPtrType* layer) { layer->reset(); }
static void RecursiveUpdateNumChildren(LayerType* layer) {
@@ -286,7 +278,7 @@ template <typename Types> class OcclusionTrackerTest : public testing::Test {
void DestroyLayers() {
Types::DestroyLayer(&root_);
- render_surface_layer_list_.reset();
+ render_surface_layer_list_ = nullptr;
render_surface_layer_list_impl_.clear();
replica_layers_.clear();
mask_layers_.clear();
« no previous file with comments | « cc/trees/occlusion_tracker_perftest.cc ('k') | cc/trees/single_thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698