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

Unified Diff: third_party/WebKit/Source/core/animation/PrimitiveInterpolation.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/animation/PrimitiveInterpolation.h
diff --git a/third_party/WebKit/Source/core/animation/PrimitiveInterpolation.h b/third_party/WebKit/Source/core/animation/PrimitiveInterpolation.h
index cc07984c426c85eb0fc542a2efd16fb8be96a1f2..5a74b4be30e4e3ff4ad41752785bbcb3317b5935 100644
--- a/third_party/WebKit/Source/core/animation/PrimitiveInterpolation.h
+++ b/third_party/WebKit/Source/core/animation/PrimitiveInterpolation.h
@@ -8,8 +8,10 @@
#include "core/animation/TypedInterpolationValue.h"
#include "platform/animation/AnimationUtilities.h"
#include "platform/heap/Handle.h"
+#include "wtf/PtrUtil.h"
#include "wtf/Vector.h"
#include <cmath>
+#include <memory>
namespace blink {
@@ -23,7 +25,7 @@ class PrimitiveInterpolation {
public:
virtual ~PrimitiveInterpolation() { }
- virtual void interpolateValue(double fraction, OwnPtr<TypedInterpolationValue>& result) const = 0;
+ virtual void interpolateValue(double fraction, std::unique_ptr<TypedInterpolationValue>& result) const = 0;
virtual double interpolateUnderlyingFraction(double start, double end, double fraction) const = 0;
virtual bool isFlip() const { return false; }
@@ -36,20 +38,20 @@ class PairwisePrimitiveInterpolation : public PrimitiveInterpolation {
public:
~PairwisePrimitiveInterpolation() override { }
- static PassOwnPtr<PairwisePrimitiveInterpolation> create(const InterpolationType& type, PassOwnPtr<InterpolableValue> start, PassOwnPtr<InterpolableValue> end, PassRefPtr<NonInterpolableValue> nonInterpolableValue)
+ static std::unique_ptr<PairwisePrimitiveInterpolation> create(const InterpolationType& type, std::unique_ptr<InterpolableValue> start, std::unique_ptr<InterpolableValue> end, PassRefPtr<NonInterpolableValue> nonInterpolableValue)
{
- return adoptPtr(new PairwisePrimitiveInterpolation(type, std::move(start), std::move(end), nonInterpolableValue));
+ return wrapUnique(new PairwisePrimitiveInterpolation(type, std::move(start), std::move(end), nonInterpolableValue));
}
const InterpolationType& type() const { return m_type; }
- PassOwnPtr<TypedInterpolationValue> initialValue() const
+ std::unique_ptr<TypedInterpolationValue> initialValue() const
{
return TypedInterpolationValue::create(m_type, m_start->clone(), m_nonInterpolableValue);
}
private:
- PairwisePrimitiveInterpolation(const InterpolationType& type, PassOwnPtr<InterpolableValue> start, PassOwnPtr<InterpolableValue> end, PassRefPtr<NonInterpolableValue> nonInterpolableValue)
+ PairwisePrimitiveInterpolation(const InterpolationType& type, std::unique_ptr<InterpolableValue> start, std::unique_ptr<InterpolableValue> end, PassRefPtr<NonInterpolableValue> nonInterpolableValue)
: m_type(type)
, m_start(std::move(start))
, m_end(std::move(end))
@@ -59,7 +61,7 @@ private:
ASSERT(m_end);
}
- void interpolateValue(double fraction, OwnPtr<TypedInterpolationValue>& result) const final
+ void interpolateValue(double fraction, std::unique_ptr<TypedInterpolationValue>& result) const final
{
ASSERT(result);
ASSERT(&result->type() == &m_type);
@@ -70,8 +72,8 @@ private:
double interpolateUnderlyingFraction(double start, double end, double fraction) const final { return blend(start, end, fraction); }
const InterpolationType& m_type;
- OwnPtr<InterpolableValue> m_start;
- OwnPtr<InterpolableValue> m_end;
+ std::unique_ptr<InterpolableValue> m_start;
+ std::unique_ptr<InterpolableValue> m_end;
RefPtr<NonInterpolableValue> m_nonInterpolableValue;
};
@@ -80,19 +82,19 @@ class FlipPrimitiveInterpolation : public PrimitiveInterpolation {
public:
~FlipPrimitiveInterpolation() override { }
- static PassOwnPtr<FlipPrimitiveInterpolation> create(PassOwnPtr<TypedInterpolationValue> start, PassOwnPtr<TypedInterpolationValue> end)
+ static std::unique_ptr<FlipPrimitiveInterpolation> create(std::unique_ptr<TypedInterpolationValue> start, std::unique_ptr<TypedInterpolationValue> end)
{
- return adoptPtr(new FlipPrimitiveInterpolation(std::move(start), std::move(end)));
+ return wrapUnique(new FlipPrimitiveInterpolation(std::move(start), std::move(end)));
}
private:
- FlipPrimitiveInterpolation(PassOwnPtr<TypedInterpolationValue> start, PassOwnPtr<TypedInterpolationValue> end)
+ FlipPrimitiveInterpolation(std::unique_ptr<TypedInterpolationValue> start, std::unique_ptr<TypedInterpolationValue> end)
: m_start(std::move(start))
, m_end(std::move(end))
, m_lastFraction(std::numeric_limits<double>::quiet_NaN())
{ }
- void interpolateValue(double fraction, OwnPtr<TypedInterpolationValue>& result) const final
+ void interpolateValue(double fraction, std::unique_ptr<TypedInterpolationValue>& result) const final
{
// TODO(alancutter): Remove this optimisation once Oilpan is default.
if (!std::isnan(m_lastFraction) && (fraction < 0.5) == (m_lastFraction < 0.5))
@@ -106,8 +108,8 @@ private:
bool isFlip() const final { return true; }
- OwnPtr<TypedInterpolationValue> m_start;
- OwnPtr<TypedInterpolationValue> m_end;
+ std::unique_ptr<TypedInterpolationValue> m_start;
+ std::unique_ptr<TypedInterpolationValue> m_end;
mutable double m_lastFraction;
};

Powered by Google App Engine
This is Rietveld 408576698