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

Side by Side Diff: cc/tiles/eviction_tile_priority_queue.cc

Issue 2258833002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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 unified diff | Download patch
« no previous file with comments | « cc/test/test_shared_bitmap_manager.cc ('k') | cc/tiles/picture_layer_tiling_set.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "cc/tiles/eviction_tile_priority_queue.h" 5 #include "cc/tiles/eviction_tile_priority_queue.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 8
9 namespace cc { 9 namespace cc {
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 TreePriority tree_priority_; 64 TreePriority tree_priority_;
65 }; 65 };
66 66
67 void CreateTilingSetEvictionQueues( 67 void CreateTilingSetEvictionQueues(
68 const std::vector<PictureLayerImpl*>& layers, 68 const std::vector<PictureLayerImpl*>& layers,
69 TreePriority tree_priority, 69 TreePriority tree_priority,
70 std::vector<std::unique_ptr<TilingSetEvictionQueue>>* queues) { 70 std::vector<std::unique_ptr<TilingSetEvictionQueue>>* queues) {
71 DCHECK(queues->empty()); 71 DCHECK(queues->empty());
72 72
73 for (auto* layer : layers) { 73 for (auto* layer : layers) {
74 std::unique_ptr<TilingSetEvictionQueue> tiling_set_queue = base::WrapUnique( 74 std::unique_ptr<TilingSetEvictionQueue> tiling_set_queue =
75 new TilingSetEvictionQueue(layer->picture_layer_tiling_set())); 75 base::MakeUnique<TilingSetEvictionQueue>(
76 layer->picture_layer_tiling_set());
76 // Queues will only contain non empty tiling sets. 77 // Queues will only contain non empty tiling sets.
77 if (!tiling_set_queue->IsEmpty()) 78 if (!tiling_set_queue->IsEmpty())
78 queues->push_back(std::move(tiling_set_queue)); 79 queues->push_back(std::move(tiling_set_queue));
79 } 80 }
80 std::make_heap(queues->begin(), queues->end(), 81 std::make_heap(queues->begin(), queues->end(),
81 EvictionOrderComparator(tree_priority)); 82 EvictionOrderComparator(tree_priority));
82 } 83 }
83 84
84 } // namespace 85 } // namespace
85 86
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 : active_queues_; 163 : active_queues_;
163 } 164 }
164 165
165 // Return tile with a lower priority. 166 // Return tile with a lower priority.
166 if (pending_priority.IsHigherPriorityThan(active_priority)) 167 if (pending_priority.IsHigherPriorityThan(active_priority))
167 return active_queues_; 168 return active_queues_;
168 return pending_queues_; 169 return pending_queues_;
169 } 170 }
170 171
171 } // namespace cc 172 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/test_shared_bitmap_manager.cc ('k') | cc/tiles/picture_layer_tiling_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698