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

Side by Side Diff: third_party/WebKit/Source/core/animation/InterpolationValue.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 InterpolationValue_h 5 #ifndef InterpolationValue_h
6 #define InterpolationValue_h 6 #define InterpolationValue_h
7 7
8 #include "core/animation/InterpolableValue.h" 8 #include "core/animation/InterpolableValue.h"
9 #include "core/animation/NonInterpolableValue.h" 9 #include "core/animation/NonInterpolableValue.h"
10 #include "platform/heap/Handle.h" 10 #include "platform/heap/Handle.h"
11 #include <memory>
12 11
13 namespace blink { 12 namespace blink {
14 13
15 // Represents a (non-strict) subset of a PropertySpecificKeyframe's value broken down into interpolable and non-interpolable parts. 14 // Represents a (non-strict) subset of a PropertySpecificKeyframe's value broken down into interpolable and non-interpolable parts.
16 // InterpolationValues can be composed together to represent a whole PropertySpe cificKeyframe value. 15 // InterpolationValues can be composed together to represent a whole PropertySpe cificKeyframe value.
17 struct InterpolationValue { 16 struct InterpolationValue {
18 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); 17 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
19 18
20 explicit InterpolationValue(std::unique_ptr<InterpolableValue> interpolableV alue, PassRefPtr<NonInterpolableValue> nonInterpolableValue = nullptr) 19 explicit InterpolationValue(PassOwnPtr<InterpolableValue> interpolableValue, PassRefPtr<NonInterpolableValue> nonInterpolableValue = nullptr)
21 : interpolableValue(std::move(interpolableValue)) 20 : interpolableValue(std::move(interpolableValue))
22 , nonInterpolableValue(nonInterpolableValue) 21 , nonInterpolableValue(nonInterpolableValue)
23 { } 22 { }
24 23
25 InterpolationValue(std::nullptr_t) { } 24 InterpolationValue(std::nullptr_t) { }
26 25
27 InterpolationValue(InterpolationValue&& other) 26 InterpolationValue(InterpolationValue&& other)
28 : interpolableValue(std::move(other.interpolableValue)) 27 : interpolableValue(std::move(other.interpolableValue))
29 , nonInterpolableValue(other.nonInterpolableValue.release()) 28 , nonInterpolableValue(other.nonInterpolableValue.release())
30 { } 29 { }
(...skipping 10 matching lines...) Expand all
41 { 40 {
42 return InterpolationValue(interpolableValue ? interpolableValue->clone() : nullptr, nonInterpolableValue); 41 return InterpolationValue(interpolableValue ? interpolableValue->clone() : nullptr, nonInterpolableValue);
43 } 42 }
44 43
45 void clear() 44 void clear()
46 { 45 {
47 interpolableValue.reset(); 46 interpolableValue.reset();
48 nonInterpolableValue.clear(); 47 nonInterpolableValue.clear();
49 } 48 }
50 49
51 std::unique_ptr<InterpolableValue> interpolableValue; 50 OwnPtr<InterpolableValue> interpolableValue;
52 RefPtr<NonInterpolableValue> nonInterpolableValue; 51 RefPtr<NonInterpolableValue> nonInterpolableValue;
53 }; 52 };
54 53
55 } // namespace blink 54 } // namespace blink
56 55
57 #endif // InterpolationValue_h 56 #endif // InterpolationValue_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698