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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 1437413002: cc: Remove ScopedPtrVector and cc::remove_if. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: just the vector Created 5 years, 1 month 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
Index: cc/trees/layer_tree_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 622894949aca12fb11f1604c9593ff5ee45130d4..911d34da5874ebefdd9445340abed546c311e7be 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -554,7 +554,7 @@ gfx::Rect LayerTreeImpl::RootScrollLayerDeviceViewportBounds() const {
: InnerViewportScrollLayer();
if (!root_scroll_layer || root_scroll_layer->children().empty())
return gfx::Rect();
- LayerImpl* layer = root_scroll_layer->children()[0];
+ LayerImpl* layer = root_scroll_layer->children()[0].get();
return MathUtil::MapEnclosingClippedRect(layer->screen_space_transform(),
gfx::Rect(layer->bounds()));
}
@@ -865,7 +865,7 @@ void LayerTreeImpl::DidBecomeActive() {
root_layer(), [](LayerImpl* layer) { layer->DidBecomeActive(); });
}
- for (auto* swap_promise : swap_promise_list_)
+ for (const scoped_ptr<SwapPromise>& swap_promise : swap_promise_list_)
danakj 2015/11/17 01:12:19 auto
vmpstr 2015/11/17 23:26:25 Done.
swap_promise->DidActivate();
devtools_instrumentation::DidActivateLayerTree(layer_tree_host_impl_->id(),
source_frame_number_);
@@ -1078,12 +1078,12 @@ void LayerTreeImpl::AsValueInto(base::trace_event::TracedValue* state) const {
state->EndArray();
state->BeginArray("swap_promise_trace_ids");
- for (auto* swap_promise : swap_promise_list_)
+ for (const scoped_ptr<SwapPromise>& swap_promise : swap_promise_list_)
danakj 2015/11/17 01:12:19 auto
vmpstr 2015/11/17 23:26:25 Done.
state->AppendDouble(swap_promise->TraceId());
state->EndArray();
state->BeginArray("pinned_swap_promise_trace_ids");
- for (auto* swap_promise : pinned_swap_promise_list_)
+ for (const scoped_ptr<SwapPromise>& swap_promise : pinned_swap_promise_list_)
danakj 2015/11/17 01:12:19 auto
vmpstr 2015/11/17 23:26:25 Done.
state->AppendDouble(swap_promise->TraceId());
state->EndArray();
}
@@ -1133,27 +1133,27 @@ void LayerTreeImpl::QueuePinnedSwapPromise(
}
void LayerTreeImpl::PassSwapPromises(
- ScopedPtrVector<SwapPromise>* new_swap_promise) {
- for (auto* swap_promise : swap_promise_list_)
+ std::vector<scoped_ptr<SwapPromise>>* new_swap_promise) {
+ for (const scoped_ptr<SwapPromise>& swap_promise : swap_promise_list_)
danakj 2015/11/17 01:12:19 auto
vmpstr 2015/11/17 23:26:25 Done.
swap_promise->DidNotSwap(SwapPromise::SWAP_FAILS);
swap_promise_list_.clear();
swap_promise_list_.swap(*new_swap_promise);
}
void LayerTreeImpl::FinishSwapPromises(CompositorFrameMetadata* metadata) {
- for (auto* swap_promise : swap_promise_list_)
+ for (const scoped_ptr<SwapPromise>& swap_promise : swap_promise_list_)
danakj 2015/11/17 01:12:19 auto
vmpstr 2015/11/17 23:26:25 Done.
swap_promise->DidSwap(metadata);
swap_promise_list_.clear();
- for (auto* swap_promise : pinned_swap_promise_list_)
+ for (const scoped_ptr<SwapPromise>& swap_promise : swap_promise_list_)
ericrk 2015/11/16 21:59:49 did you mean to use a different list?
danakj 2015/11/17 01:12:19 also, auto
vmpstr 2015/11/17 23:26:25 Done.
vmpstr 2015/11/17 23:26:25 Whoops. Thanks for catching this!
swap_promise->DidSwap(metadata);
pinned_swap_promise_list_.clear();
}
void LayerTreeImpl::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) {
- for (auto* swap_promise : swap_promise_list_)
+ for (const scoped_ptr<SwapPromise>& swap_promise : swap_promise_list_)
danakj 2015/11/17 01:12:19 auto
vmpstr 2015/11/17 23:26:25 Done.
swap_promise->DidNotSwap(reason);
swap_promise_list_.clear();
- for (auto* swap_promise : pinned_swap_promise_list_)
+ for (const scoped_ptr<SwapPromise>& swap_promise : swap_promise_list_)
ericrk 2015/11/16 21:59:49 same here?
danakj 2015/11/17 01:12:19 also, auto
vmpstr 2015/11/17 23:26:25 Done.
vmpstr 2015/11/17 23:26:25 Done.
swap_promise->DidNotSwap(reason);
pinned_swap_promise_list_.clear();
}
@@ -1492,8 +1492,8 @@ static void FindClosestMatchingLayer(
size_t children_size = layer->children().size();
for (size_t i = 0; i < children_size; ++i) {
size_t index = children_size - 1 - i;
- FindClosestMatchingLayer(screen_space_point, layer->children()[index], func,
- transform_tree, use_property_trees,
+ FindClosestMatchingLayer(screen_space_point, layer->children()[index].get(),
+ func, transform_tree, use_property_trees,
data_for_recursion);
}

Powered by Google App Engine
This is Rietveld 408576698