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

Side by Side Diff: third_party/WebKit/Source/core/animation/css/CSSTransitionData.h

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CSSTransitionData_h 5 #ifndef CSSTransitionData_h
6 #define CSSTransitionData_h 6 #define CSSTransitionData_h
7 7
8 #include "core/CSSPropertyNames.h" 8 #include "core/CSSPropertyNames.h"
9 #include "core/animation/css/CSSTimingData.h" 9 #include "core/animation/css/CSSTimingData.h"
10 #include "wtf/PtrUtil.h"
11 #include "wtf/Vector.h" 10 #include "wtf/Vector.h"
12 #include <memory>
13 11
14 namespace blink { 12 namespace blink {
15 13
16 class CSSTransitionData final : public CSSTimingData { 14 class CSSTransitionData final : public CSSTimingData {
17 public: 15 public:
18 enum TransitionPropertyType { 16 enum TransitionPropertyType {
19 TransitionNone, 17 TransitionNone,
20 TransitionKnownProperty, 18 TransitionKnownProperty,
21 TransitionUnknownProperty, 19 TransitionUnknownProperty,
22 }; 20 };
(...skipping 22 matching lines...) Expand all
45 ASSERT(type == TransitionNone); 43 ASSERT(type == TransitionNone);
46 } 44 }
47 45
48 bool operator==(const TransitionProperty& other) const { return property Type == other.propertyType && unresolvedProperty == other.unresolvedProperty && propertyString == other.propertyString; } 46 bool operator==(const TransitionProperty& other) const { return property Type == other.propertyType && unresolvedProperty == other.unresolvedProperty && propertyString == other.propertyString; }
49 47
50 TransitionPropertyType propertyType; 48 TransitionPropertyType propertyType;
51 CSSPropertyID unresolvedProperty; 49 CSSPropertyID unresolvedProperty;
52 String propertyString; 50 String propertyString;
53 }; 51 };
54 52
55 static std::unique_ptr<CSSTransitionData> create() 53 static PassOwnPtr<CSSTransitionData> create()
56 { 54 {
57 return wrapUnique(new CSSTransitionData); 55 return adoptPtr(new CSSTransitionData);
58 } 56 }
59 57
60 static std::unique_ptr<CSSTransitionData> create(const CSSTransitionData& tr ansitionData) 58 static PassOwnPtr<CSSTransitionData> create(const CSSTransitionData& transit ionData)
61 { 59 {
62 return wrapUnique(new CSSTransitionData(transitionData)); 60 return adoptPtr(new CSSTransitionData(transitionData));
63 } 61 }
64 62
65 bool transitionsMatchForStyleRecalc(const CSSTransitionData& other) const; 63 bool transitionsMatchForStyleRecalc(const CSSTransitionData& other) const;
66 64
67 Timing convertToTiming(size_t index) const; 65 Timing convertToTiming(size_t index) const;
68 66
69 const Vector<TransitionProperty>& propertyList() const { return m_propertyLi st; } 67 const Vector<TransitionProperty>& propertyList() const { return m_propertyLi st; }
70 Vector<TransitionProperty>& propertyList() { return m_propertyList; } 68 Vector<TransitionProperty>& propertyList() { return m_propertyList; }
71 69
72 static TransitionProperty initialProperty() { return TransitionProperty(CSSP ropertyAll); } 70 static TransitionProperty initialProperty() { return TransitionProperty(CSSP ropertyAll); }
73 71
74 private: 72 private:
75 CSSTransitionData(); 73 CSSTransitionData();
76 explicit CSSTransitionData(const CSSTransitionData&); 74 explicit CSSTransitionData(const CSSTransitionData&);
77 75
78 Vector<TransitionProperty> m_propertyList; 76 Vector<TransitionProperty> m_propertyList;
79 }; 77 };
80 78
81 } // namespace blink 79 } // namespace blink
82 80
83 #endif // CSSTransitionData_h 81 #endif // CSSTransitionData_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698