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

Unified Diff: ui/compositor/layer_animation_sequence.h

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
Index: ui/compositor/layer_animation_sequence.h
diff --git a/ui/compositor/layer_animation_sequence.h b/ui/compositor/layer_animation_sequence.h
index e050439da7eed4a7687f224b309596bb1448b05d..c48e91a6a8cb60ad1cf1062605cf61652f84acb4 100644
--- a/ui/compositor/layer_animation_sequence.h
+++ b/ui/compositor/layer_animation_sequence.h
@@ -7,11 +7,11 @@
#include <stddef.h>
+#include <memory>
#include <vector>
#include "base/gtest_prod_util.h"
#include "base/macros.h"
-#include "base/memory/linked_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "base/time/time.h"
@@ -41,7 +41,8 @@ class COMPOSITOR_EXPORT LayerAnimationSequence
public:
LayerAnimationSequence();
// Takes ownership of the given element and adds it to the sequence.
- explicit LayerAnimationSequence(LayerAnimationElement* element);
+ explicit LayerAnimationSequence(
+ std::unique_ptr<LayerAnimationElement> element);
virtual ~LayerAnimationSequence();
// Sets the start time for the animation. This must be called before the
@@ -90,7 +91,7 @@ class COMPOSITOR_EXPORT LayerAnimationSequence
// Adds an element to the sequence. The sequences takes ownership of this
// element.
- void AddElement(LayerAnimationElement* element);
+ void AddElement(std::unique_ptr<LayerAnimationElement> element);
// Sequences can be looped indefinitely.
void set_is_cyclic(bool is_cyclic) { is_cyclic_ = is_cyclic; }
@@ -137,7 +138,7 @@ class COMPOSITOR_EXPORT LayerAnimationSequence
private:
friend class LayerAnimatorTestController;
- typedef std::vector<linked_ptr<LayerAnimationElement> > Elements;
+ using Elements = std::vector<std::unique_ptr<LayerAnimationElement>>;
FRIEND_TEST_ALL_PREFIXES(LayerAnimatorTest,
ObserverReleasedBeforeAnimationSequenceEnds);

Powered by Google App Engine
This is Rietveld 408576698