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

Unified Diff: cc/animation/timing_function.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
« no previous file with comments | « cc/animation/timing_function.h ('k') | cc/animation/transform_operations.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/timing_function.cc
diff --git a/cc/animation/timing_function.cc b/cc/animation/timing_function.cc
index 94bf12874d30eeba4b6c65352e39bd6078e6caaf..ad8d36876a65ca99fafeacd90ca8230b37644a4d 100644
--- a/cc/animation/timing_function.cc
+++ b/cc/animation/timing_function.cc
@@ -2,9 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "cc/animation/timing_function.h"
+
+#include <memory>
+
+#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "cc/base/math_util.h"
namespace cc {
@@ -13,9 +16,9 @@ TimingFunction::TimingFunction() {}
TimingFunction::~TimingFunction() {}
-scoped_ptr<CubicBezierTimingFunction> CubicBezierTimingFunction::Create(
- double x1, double y1, double x2, double y2) {
- return make_scoped_ptr(new CubicBezierTimingFunction(x1, y1, x2, y2));
+std::unique_ptr<CubicBezierTimingFunction>
+CubicBezierTimingFunction::Create(double x1, double y1, double x2, double y2) {
+ return base::WrapUnique(new CubicBezierTimingFunction(x1, y1, x2, y2));
}
CubicBezierTimingFunction::CubicBezierTimingFunction(double x1,
@@ -42,32 +45,32 @@ void CubicBezierTimingFunction::Range(float* min, float* max) const {
*max = static_cast<float>(max_d);
}
-scoped_ptr<TimingFunction> CubicBezierTimingFunction::Clone() const {
- return make_scoped_ptr(new CubicBezierTimingFunction(*this));
+std::unique_ptr<TimingFunction> CubicBezierTimingFunction::Clone() const {
+ return base::WrapUnique(new CubicBezierTimingFunction(*this));
}
// These numbers come from
// http://www.w3.org/TR/css3-transitions/#transition-timing-function_tag.
-scoped_ptr<TimingFunction> EaseTimingFunction::Create() {
+std::unique_ptr<TimingFunction> EaseTimingFunction::Create() {
return CubicBezierTimingFunction::Create(0.25, 0.1, 0.25, 1.0);
}
-scoped_ptr<TimingFunction> EaseInTimingFunction::Create() {
+std::unique_ptr<TimingFunction> EaseInTimingFunction::Create() {
return CubicBezierTimingFunction::Create(0.42, 0.0, 1.0, 1.0);
}
-scoped_ptr<TimingFunction> EaseOutTimingFunction::Create() {
+std::unique_ptr<TimingFunction> EaseOutTimingFunction::Create() {
return CubicBezierTimingFunction::Create(0.0, 0.0, 0.58, 1.0);
}
-scoped_ptr<TimingFunction> EaseInOutTimingFunction::Create() {
+std::unique_ptr<TimingFunction> EaseInOutTimingFunction::Create() {
return CubicBezierTimingFunction::Create(0.42, 0.0, 0.58, 1);
}
-scoped_ptr<StepsTimingFunction> StepsTimingFunction::Create(
+std::unique_ptr<StepsTimingFunction> StepsTimingFunction::Create(
int steps,
float steps_start_offset) {
- return make_scoped_ptr(new StepsTimingFunction(steps, steps_start_offset));
+ return base::WrapUnique(new StepsTimingFunction(steps, steps_start_offset));
}
StepsTimingFunction::StepsTimingFunction(int steps, float steps_start_offset)
@@ -88,8 +91,8 @@ float StepsTimingFunction::GetValue(double t) const {
return static_cast<float>(value);
}
-scoped_ptr<TimingFunction> StepsTimingFunction::Clone() const {
- return make_scoped_ptr(new StepsTimingFunction(*this));
+std::unique_ptr<TimingFunction> StepsTimingFunction::Clone() const {
+ return base::WrapUnique(new StepsTimingFunction(*this));
}
void StepsTimingFunction::Range(float* min, float* max) const {
« no previous file with comments | « cc/animation/timing_function.h ('k') | cc/animation/transform_operations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698