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

Side by Side Diff: third_party/WebKit/Source/platform/exported/WebActiveGestureAnimation.h

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 11 matching lines...) Expand all
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef WebActiveGestureAnimation_h 26 #ifndef WebActiveGestureAnimation_h
27 #define WebActiveGestureAnimation_h 27 #define WebActiveGestureAnimation_h
28 28
29 #include "platform/PlatformExport.h" 29 #include "platform/PlatformExport.h"
30 #include "wtf/Allocator.h" 30 #include "wtf/Allocator.h"
31 #include "wtf/Noncopyable.h" 31 #include "wtf/Noncopyable.h"
32 #include "wtf/OwnPtr.h" 32 #include <memory>
33 #include "wtf/PassOwnPtr.h"
34 33
35 namespace blink { 34 namespace blink {
36 35
37 class WebGestureCurve; 36 class WebGestureCurve;
38 class WebGestureCurveTarget; 37 class WebGestureCurveTarget;
39 38
40 // Implements a gesture animation (fling scroll, etc.) using a curve with a gene ric interface 39 // Implements a gesture animation (fling scroll, etc.) using a curve with a gene ric interface
41 // to define the animation parameters as a function of time, and applies the ani mation 40 // to define the animation parameters as a function of time, and applies the ani mation
42 // to a target, again via a generic interface. It is assumed that animate() is c alled 41 // to a target, again via a generic interface. It is assumed that animate() is c alled
43 // on a more-or-less regular basis by the owner. 42 // on a more-or-less regular basis by the owner.
44 class PLATFORM_EXPORT WebActiveGestureAnimation { 43 class PLATFORM_EXPORT WebActiveGestureAnimation {
45 USING_FAST_MALLOC(WebActiveGestureAnimation); 44 USING_FAST_MALLOC(WebActiveGestureAnimation);
46 WTF_MAKE_NONCOPYABLE(WebActiveGestureAnimation); 45 WTF_MAKE_NONCOPYABLE(WebActiveGestureAnimation);
47 public: 46 public:
48 static PassOwnPtr<WebActiveGestureAnimation> createAtAnimationStart(PassOwnP tr<WebGestureCurve>, WebGestureCurveTarget*); 47 static std::unique_ptr<WebActiveGestureAnimation> createAtAnimationStart(std ::unique_ptr<WebGestureCurve>, WebGestureCurveTarget*);
49 static PassOwnPtr<WebActiveGestureAnimation> createWithTimeOffset(PassOwnPtr <WebGestureCurve>, WebGestureCurveTarget*, double startTime); 48 static std::unique_ptr<WebActiveGestureAnimation> createWithTimeOffset(std:: unique_ptr<WebGestureCurve>, WebGestureCurveTarget*, double startTime);
50 ~WebActiveGestureAnimation(); 49 ~WebActiveGestureAnimation();
51 50
52 bool animate(double time); 51 bool animate(double time);
53 52
54 private: 53 private:
55 // Assumes a valid WebGestureCurveTarget that outlives the animation. 54 // Assumes a valid WebGestureCurveTarget that outlives the animation.
56 WebActiveGestureAnimation(PassOwnPtr<WebGestureCurve>, WebGestureCurveTarget *, double startTime, bool waitingForFirstTick); 55 WebActiveGestureAnimation(std::unique_ptr<WebGestureCurve>, WebGestureCurveT arget*, double startTime, bool waitingForFirstTick);
57 56
58 double m_startTime; 57 double m_startTime;
59 bool m_waitingForFirstTick; 58 bool m_waitingForFirstTick;
60 OwnPtr<WebGestureCurve> m_curve; 59 std::unique_ptr<WebGestureCurve> m_curve;
61 WebGestureCurveTarget* m_target; 60 WebGestureCurveTarget* m_target;
62 }; 61 };
63 62
64 } // namespace blink 63 } // namespace blink
65 64
66 #endif 65 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698