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

Unified Diff: cc/animation/scroll_offset_animation_curve.cc

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase 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 side-by-side diff with in-line comments
Download patch
Index: cc/animation/scroll_offset_animation_curve.cc
diff --git a/cc/animation/scroll_offset_animation_curve.cc b/cc/animation/scroll_offset_animation_curve.cc
index 86448b73b4409c63fcb99163b2776f5489213b6c..54f6fb70d8cb80941011638d0dcc0ff0ecd3909b 100644
--- a/cc/animation/scroll_offset_animation_curve.cc
+++ b/cc/animation/scroll_offset_animation_curve.cc
@@ -8,6 +8,7 @@
#include <cmath>
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "cc/animation/timing_function.h"
#include "cc/base/time_util.h"
#include "ui/gfx/animation/tween.h"
@@ -63,7 +64,8 @@ static base::TimeDelta SegmentDuration(const gfx::Vector2dF& delta,
base::Time::kMicrosecondsPerSecond);
}
-static scoped_ptr<TimingFunction> EaseOutWithInitialVelocity(double velocity) {
+static std::unique_ptr<TimingFunction> EaseOutWithInitialVelocity(
+ double velocity) {
// Clamp velocity to a sane value.
velocity = std::min(std::max(velocity, -1000.0), 1000.0);
@@ -75,17 +77,17 @@ static scoped_ptr<TimingFunction> EaseOutWithInitialVelocity(double velocity) {
} // namespace
-scoped_ptr<ScrollOffsetAnimationCurve> ScrollOffsetAnimationCurve::Create(
+std::unique_ptr<ScrollOffsetAnimationCurve> ScrollOffsetAnimationCurve::Create(
const gfx::ScrollOffset& target_value,
- scoped_ptr<TimingFunction> timing_function,
+ std::unique_ptr<TimingFunction> timing_function,
DurationBehavior duration_behavior) {
- return make_scoped_ptr(new ScrollOffsetAnimationCurve(
+ return base::WrapUnique(new ScrollOffsetAnimationCurve(
target_value, std::move(timing_function), duration_behavior));
}
ScrollOffsetAnimationCurve::ScrollOffsetAnimationCurve(
const gfx::ScrollOffset& target_value,
- scoped_ptr<TimingFunction> timing_function,
+ std::unique_ptr<TimingFunction> timing_function,
DurationBehavior duration_behavior)
: target_value_(target_value),
timing_function_(std::move(timing_function)),
@@ -133,15 +135,15 @@ AnimationCurve::CurveType ScrollOffsetAnimationCurve::Type() const {
return SCROLL_OFFSET;
}
-scoped_ptr<AnimationCurve> ScrollOffsetAnimationCurve::Clone() const {
+std::unique_ptr<AnimationCurve> ScrollOffsetAnimationCurve::Clone() const {
return CloneToScrollOffsetAnimationCurve();
}
-scoped_ptr<ScrollOffsetAnimationCurve>
+std::unique_ptr<ScrollOffsetAnimationCurve>
ScrollOffsetAnimationCurve::CloneToScrollOffsetAnimationCurve() const {
- scoped_ptr<TimingFunction> timing_function(
+ std::unique_ptr<TimingFunction> timing_function(
static_cast<TimingFunction*>(timing_function_->Clone().release()));
- scoped_ptr<ScrollOffsetAnimationCurve> curve_clone =
+ std::unique_ptr<ScrollOffsetAnimationCurve> curve_clone =
Create(target_value_, std::move(timing_function), duration_behavior_);
curve_clone->initial_value_ = initial_value_;
curve_clone->total_animation_duration_ = total_animation_duration_;
« no previous file with comments | « cc/animation/scroll_offset_animation_curve.h ('k') | cc/animation/scroll_offset_animation_curve_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698