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

Unified Diff: ui/compositor/layer_owner.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr 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 | « ui/compositor/layer_owner.h ('k') | ui/compositor/layer_owner_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer_owner.cc
diff --git a/ui/compositor/layer_owner.cc b/ui/compositor/layer_owner.cc
index 44bb322ff6cdb07947cd7bd95a4e0e13a4971767..9fe0b96b6c33a3a093fc669ebcd2623b26a93ab9 100644
--- a/ui/compositor/layer_owner.cc
+++ b/ui/compositor/layer_owner.cc
@@ -6,6 +6,7 @@
#include <utility>
+#include "base/memory/ptr_util.h"
#include "ui/compositor/layer_owner_delegate.h"
namespace ui {
@@ -23,14 +24,14 @@ void LayerOwner::SetLayer(Layer* layer) {
layer_->owner_ = this;
}
-scoped_ptr<Layer> LayerOwner::AcquireLayer() {
+std::unique_ptr<Layer> LayerOwner::AcquireLayer() {
if (layer_owner_)
layer_owner_->owner_ = NULL;
return std::move(layer_owner_);
}
-scoped_ptr<Layer> LayerOwner::RecreateLayer() {
- scoped_ptr<ui::Layer> old_layer(AcquireLayer());
+std::unique_ptr<Layer> LayerOwner::RecreateLayer() {
+ std::unique_ptr<ui::Layer> old_layer(AcquireLayer());
if (!old_layer)
return old_layer;
@@ -54,7 +55,7 @@ scoped_ptr<Layer> LayerOwner::RecreateLayer() {
new_layer->SetColor(old_layer->GetTargetColor());
SkRegion* alpha_shape = old_layer->alpha_shape();
if (alpha_shape)
- new_layer->SetAlphaShape(make_scoped_ptr(new SkRegion(*alpha_shape)));
+ new_layer->SetAlphaShape(base::WrapUnique(new SkRegion(*alpha_shape)));
if (old_layer->parent()) {
// Install new layer as a sibling of the old layer, stacked below it.
« no previous file with comments | « ui/compositor/layer_owner.h ('k') | ui/compositor/layer_owner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698