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

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

Issue 1878253003: Allow explicit conversion operators and implement WTF::OwnPtr::operator bool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 8 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"
(...skipping 16 matching lines...) Expand all
27 : interpolableValue(other.interpolableValue.release()) 27 : interpolableValue(other.interpolableValue.release())
28 , nonInterpolableValue(other.nonInterpolableValue.release()) 28 , nonInterpolableValue(other.nonInterpolableValue.release())
29 { } 29 { }
30 30
31 void operator=(InterpolationValue&& other) 31 void operator=(InterpolationValue&& other)
32 { 32 {
33 interpolableValue = other.interpolableValue.release(); 33 interpolableValue = other.interpolableValue.release();
34 nonInterpolableValue = other.nonInterpolableValue.release(); 34 nonInterpolableValue = other.nonInterpolableValue.release();
35 } 35 }
36 36
37 operator bool() const { return interpolableValue; } 37 operator bool() const { return interpolableValue.get(); }
38 38
39 InterpolationValue clone() const 39 InterpolationValue clone() const
40 { 40 {
41 return InterpolationValue(interpolableValue ? interpolableValue->clone() : nullptr, nonInterpolableValue); 41 return InterpolationValue(interpolableValue ? interpolableValue->clone() : nullptr, nonInterpolableValue);
42 } 42 }
43 43
44 void clear() 44 void clear()
45 { 45 {
46 interpolableValue.clear(); 46 interpolableValue.clear();
47 nonInterpolableValue.clear(); 47 nonInterpolableValue.clear();
48 } 48 }
49 49
50 OwnPtr<InterpolableValue> interpolableValue; 50 OwnPtr<InterpolableValue> interpolableValue;
51 RefPtr<NonInterpolableValue> nonInterpolableValue; 51 RefPtr<NonInterpolableValue> nonInterpolableValue;
52 }; 52 };
53 53
54 } // namespace blink 54 } // namespace blink
55 55
56 #endif // InterpolationValue_h 56 #endif // InterpolationValue_h
OLDNEW
« no previous file with comments | « styleguide/c++/c++11.html ('k') | third_party/WebKit/Source/core/animation/PairwiseInterpolationValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698