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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase Created 4 years, 8 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/layer_tree_impl.h ('k') | cc/trees/layer_tree_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 5c2b9c6477fc236b4955197600485444549e740e..1ccef5fa7ad790bbb7778be5ebce6f1eb44d1bf4 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -275,7 +275,7 @@ void LayerTreeImpl::UpdateScrollbars(int scroll_layer_id, int clip_layer_id) {
}
}
-void LayerTreeImpl::SetRootLayer(scoped_ptr<LayerImpl> layer) {
+void LayerTreeImpl::SetRootLayer(std::unique_ptr<LayerImpl> layer) {
if (root_layer_ && layer.get() != root_layer_)
RemoveLayer(root_layer_->id());
root_layer_ = layer.get();
@@ -320,11 +320,11 @@ gfx::ScrollOffset LayerTreeImpl::TotalMaxScrollOffset() const {
return offset;
}
-scoped_ptr<OwnedLayerImplList> LayerTreeImpl::DetachLayers() {
+std::unique_ptr<OwnedLayerImplList> LayerTreeImpl::DetachLayers() {
root_layer_ = nullptr;
render_surface_layer_list_.clear();
set_needs_update_draw_properties();
- scoped_ptr<OwnedLayerImplList> ret = std::move(layers_);
+ std::unique_ptr<OwnedLayerImplList> ret = std::move(layers_);
layers_.reset(new OwnedLayerImplList);
return ret;
}
@@ -1047,19 +1047,19 @@ void LayerTreeImpl::UnregisterLayer(LayerImpl* layer) {
}
// These manage ownership of the LayerImpl.
-void LayerTreeImpl::AddLayer(scoped_ptr<LayerImpl> layer) {
+void LayerTreeImpl::AddLayer(std::unique_ptr<LayerImpl> layer) {
DCHECK(std::find(layers_->begin(), layers_->end(), layer) == layers_->end());
layers_->push_back(std::move(layer));
set_needs_update_draw_properties();
}
-scoped_ptr<LayerImpl> LayerTreeImpl::RemoveLayer(int id) {
+std::unique_ptr<LayerImpl> LayerTreeImpl::RemoveLayer(int id) {
if (root_layer_ && root_layer_->id() == id)
root_layer_ = nullptr;
for (auto it = layers_->begin(); it != layers_->end(); ++it) {
if ((*it) && (*it)->id() != id)
continue;
- scoped_ptr<LayerImpl> ret = std::move(*it);
+ std::unique_ptr<LayerImpl> ret = std::move(*it);
set_needs_update_draw_properties();
layers_->erase(it);
return ret;
@@ -1217,7 +1217,7 @@ const gfx::Rect LayerTreeImpl::ViewportRectForTilePriority() const {
return layer_tree_host_impl_->ViewportRectForTilePriority();
}
-scoped_ptr<ScrollbarAnimationController>
+std::unique_ptr<ScrollbarAnimationController>
LayerTreeImpl::CreateScrollbarAnimationController(int scroll_layer_id) {
DCHECK(settings().scrollbar_fade_delay_ms);
DCHECK(settings().scrollbar_fade_duration_ms);
@@ -1338,20 +1338,21 @@ bool LayerTreeImpl::DistributeRootScrollOffset(
return true;
}
-void LayerTreeImpl::QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise) {
+void LayerTreeImpl::QueueSwapPromise(
+ std::unique_ptr<SwapPromise> swap_promise) {
DCHECK(swap_promise);
swap_promise_list_.push_back(std::move(swap_promise));
}
void LayerTreeImpl::QueuePinnedSwapPromise(
- scoped_ptr<SwapPromise> swap_promise) {
+ std::unique_ptr<SwapPromise> swap_promise) {
DCHECK(IsActiveTree());
DCHECK(swap_promise);
pinned_swap_promise_list_.push_back(std::move(swap_promise));
}
void LayerTreeImpl::PassSwapPromises(
- std::vector<scoped_ptr<SwapPromise>>* new_swap_promise) {
+ std::vector<std::unique_ptr<SwapPromise>>* new_swap_promise) {
for (const auto& swap_promise : swap_promise_list_)
swap_promise->DidNotSwap(SwapPromise::SWAP_FAILS);
swap_promise_list_.clear();
@@ -1948,11 +1949,11 @@ VideoFrameControllerClient* LayerTreeImpl::GetVideoFrameControllerClient()
}
void LayerTreeImpl::SetPendingPageScaleAnimation(
- scoped_ptr<PendingPageScaleAnimation> pending_animation) {
+ std::unique_ptr<PendingPageScaleAnimation> pending_animation) {
pending_page_scale_animation_ = std::move(pending_animation);
}
-scoped_ptr<PendingPageScaleAnimation>
+std::unique_ptr<PendingPageScaleAnimation>
LayerTreeImpl::TakePendingPageScaleAnimation() {
return std::move(pending_page_scale_animation_);
}
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | cc/trees/layer_tree_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698