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

Side by Side Diff: third_party/WebKit/Source/core/animation/UnderlyingLengthChecker.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 UnderlyingLengthChecker_h 5 #ifndef UnderlyingLengthChecker_h
6 #define UnderlyingLengthChecker_h 6 #define UnderlyingLengthChecker_h
7 7
8 #include "core/animation/InterpolableValue.h" 8 #include "core/animation/InterpolableValue.h"
9 #include "core/animation/InterpolationType.h" 9 #include "core/animation/InterpolationType.h"
10 #include "wtf/PtrUtil.h"
11 #include <memory>
12 10
13 namespace blink { 11 namespace blink {
14 12
15 class UnderlyingLengthChecker : public InterpolationType::ConversionChecker { 13 class UnderlyingLengthChecker : public InterpolationType::ConversionChecker {
16 public: 14 public:
17 static std::unique_ptr<UnderlyingLengthChecker> create(size_t underlyingLeng th) 15 static PassOwnPtr<UnderlyingLengthChecker> create(size_t underlyingLength)
18 { 16 {
19 return wrapUnique(new UnderlyingLengthChecker(underlyingLength)); 17 return adoptPtr(new UnderlyingLengthChecker(underlyingLength));
20 } 18 }
21 19
22 static size_t getUnderlyingLength(const InterpolationValue& underlying) 20 static size_t getUnderlyingLength(const InterpolationValue& underlying)
23 { 21 {
24 if (!underlying) 22 if (!underlying)
25 return 0; 23 return 0;
26 return toInterpolableList(*underlying.interpolableValue).length(); 24 return toInterpolableList(*underlying.interpolableValue).length();
27 } 25 }
28 26
29 bool isValid(const InterpolationEnvironment&, const InterpolationValue& unde rlying) const final 27 bool isValid(const InterpolationEnvironment&, const InterpolationValue& unde rlying) const final
30 { 28 {
31 return m_underlyingLength == getUnderlyingLength(underlying); 29 return m_underlyingLength == getUnderlyingLength(underlying);
32 } 30 }
33 31
34 private: 32 private:
35 UnderlyingLengthChecker(size_t underlyingLength) 33 UnderlyingLengthChecker(size_t underlyingLength)
36 : m_underlyingLength(underlyingLength) 34 : m_underlyingLength(underlyingLength)
37 {} 35 {}
38 36
39 size_t m_underlyingLength; 37 size_t m_underlyingLength;
40 }; 38 };
41 39
42 } // namespace blink 40 } // namespace blink
43 41
44 #endif // UnderlyingLengthChecker_h 42 #endif // UnderlyingLengthChecker_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698