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

Unified Diff: cc/trees/occlusion_tracker_unittest.cc

Issue 608503005: Revert of cc: Remove use of PassAs() and constructor-casting with scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 3c6c4403690d8bd11b0484b05bc5168bdb5af1a0..b35e437bd3a955467c2ffe1ca9df32403470c54c 100644
--- a/cc/trees/occlusion_tracker_unittest.cc
+++ b/cc/trees/occlusion_tracker_unittest.cc
@@ -121,8 +121,13 @@
return make_scoped_refptr(new ContentLayerType());
}
- template <typename T>
- static LayerPtrType PassLayerPtr(T* layer) {
+ static LayerPtrType PassLayerPtr(ContentLayerPtrType* layer) {
+ LayerPtrType ref(*layer);
+ *layer = NULL;
+ return ref;
+ }
+
+ static LayerPtrType PassLayerPtr(LayerPtrType* layer) {
LayerPtrType ref(*layer);
*layer = NULL;
return ref;
@@ -151,9 +156,12 @@
}
static int next_layer_impl_id;
- template <typename T>
- static LayerPtrType PassLayerPtr(T* layer) {
+ static LayerPtrType PassLayerPtr(LayerPtrType* layer) {
return layer->Pass();
+ }
+
+ static LayerPtrType PassLayerPtr(ContentLayerPtrType* layer) {
+ return layer->PassAs<LayerType>();
}
static void DestroyLayer(LayerPtrType* layer) { layer->reset(); }
@@ -278,7 +286,7 @@
void DestroyLayers() {
Types::DestroyLayer(&root_);
- render_surface_layer_list_ = nullptr;
+ render_surface_layer_list_.reset();
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