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

Unified Diff: ui/compositor/layer_animation_sequence.cc

Issue 2550933002: Make all LayerAnimationElement::Create*Element return unique_ptr (Closed)
Patch Set: Complete inclusion Created 4 years 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_animation_sequence.h ('k') | ui/compositor/layer_animator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer_animation_sequence.cc
diff --git a/ui/compositor/layer_animation_sequence.cc b/ui/compositor/layer_animation_sequence.cc
index f4919f381a177dfec53e57824254c4ff5e19a194..773cbb4021cee7a9728bee6d9eb4c7fb48823739 100644
--- a/ui/compositor/layer_animation_sequence.cc
+++ b/ui/compositor/layer_animation_sequence.cc
@@ -25,7 +25,8 @@ LayerAnimationSequence::LayerAnimationSequence()
weak_ptr_factory_(this) {
}
-LayerAnimationSequence::LayerAnimationSequence(LayerAnimationElement* element)
+LayerAnimationSequence::LayerAnimationSequence(
+ std::unique_ptr<LayerAnimationElement> element)
: properties_(LayerAnimationElement::UNKNOWN),
is_cyclic_(false),
last_element_(0),
@@ -33,7 +34,7 @@ LayerAnimationSequence::LayerAnimationSequence(LayerAnimationElement* element)
animation_group_id_(0),
last_progressed_fraction_(0.0),
weak_ptr_factory_(this) {
- AddElement(element);
+ AddElement(std::move(element));
}
LayerAnimationSequence::~LayerAnimationSequence() {
@@ -182,9 +183,10 @@ void LayerAnimationSequence::Abort(LayerAnimationDelegate* delegate) {
NotifyAborted();
}
-void LayerAnimationSequence::AddElement(LayerAnimationElement* element) {
+void LayerAnimationSequence::AddElement(
+ std::unique_ptr<LayerAnimationElement> element) {
properties_ |= element->properties();
- elements_.push_back(make_linked_ptr(element));
+ elements_.push_back(std::move(element));
sky 2016/12/15 16:42:18 push_back->emplace_back?
Sunny 2016/12/16 10:53:49 Emm...Do you prefer emplace_back(std::move(element
danakj 2016/12/16 14:20:31 Never use release() unless you really have to. Sin
}
bool LayerAnimationSequence::HasConflictingProperty(
« no previous file with comments | « ui/compositor/layer_animation_sequence.h ('k') | ui/compositor/layer_animator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698