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

Unified Diff: third_party/WebKit/Source/core/animation/ShadowInterpolationFunctions.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/ShadowInterpolationFunctions.cpp
diff --git a/third_party/WebKit/Source/core/animation/ShadowInterpolationFunctions.cpp b/third_party/WebKit/Source/core/animation/ShadowInterpolationFunctions.cpp
index cf7c77215c0b069d93fbe1624d3dfbe3d48d857c..697f1bda280b674c9dd4786366b454fa62339ada 100644
--- a/third_party/WebKit/Source/core/animation/ShadowInterpolationFunctions.cpp
+++ b/third_party/WebKit/Source/core/animation/ShadowInterpolationFunctions.cpp
@@ -12,7 +12,6 @@
#include "core/css/resolver/StyleResolverState.h"
#include "core/style/ShadowData.h"
#include "platform/geometry/FloatPoint.h"
-#include <memory>
namespace blink {
@@ -63,7 +62,7 @@ PairwiseInterpolationValue ShadowInterpolationFunctions::maybeMergeSingles(Inter
InterpolationValue ShadowInterpolationFunctions::convertShadowData(const ShadowData& shadowData, double zoom)
{
- std::unique_ptr<InterpolableList> interpolableList = InterpolableList::create(ShadowComponentIndexCount);
+ OwnPtr<InterpolableList> interpolableList = InterpolableList::create(ShadowComponentIndexCount);
interpolableList->set(ShadowX, CSSLengthInterpolationType::createInterpolablePixels(shadowData.x() / zoom));
interpolableList->set(ShadowY, CSSLengthInterpolationType::createInterpolablePixels(shadowData.y() / zoom));
interpolableList->set(ShadowBlur, CSSLengthInterpolationType::createInterpolablePixels(shadowData.blur() / zoom));
@@ -86,7 +85,7 @@ InterpolationValue ShadowInterpolationFunctions::maybeConvertCSSValue(const CSSV
return nullptr;
}
- std::unique_ptr<InterpolableList> interpolableList = InterpolableList::create(ShadowComponentIndexCount);
+ OwnPtr<InterpolableList> interpolableList = InterpolableList::create(ShadowComponentIndexCount);
static_assert(ShadowX == 0, "Enum ordering check.");
static_assert(ShadowY == 1, "Enum ordering check.");
static_assert(ShadowBlur == 2, "Enum ordering check.");
@@ -110,7 +109,7 @@ InterpolationValue ShadowInterpolationFunctions::maybeConvertCSSValue(const CSSV
}
if (shadow.color) {
- std::unique_ptr<InterpolableValue> interpolableColor = CSSColorInterpolationType::maybeCreateInterpolableColor(*shadow.color);
+ OwnPtr<InterpolableValue> interpolableColor = CSSColorInterpolationType::maybeCreateInterpolableColor(*shadow.color);
if (!interpolableColor)
return nullptr;
interpolableList->set(ShadowColor, std::move(interpolableColor));
@@ -121,12 +120,12 @@ InterpolationValue ShadowInterpolationFunctions::maybeConvertCSSValue(const CSSV
return InterpolationValue(std::move(interpolableList), ShadowNonInterpolableValue::create(style));
}
-std::unique_ptr<InterpolableValue> ShadowInterpolationFunctions::createNeutralInterpolableValue()
+PassOwnPtr<InterpolableValue> ShadowInterpolationFunctions::createNeutralInterpolableValue()
{
return convertShadowData(ShadowData(FloatPoint(0, 0), 0, 0, Normal, StyleColor(Color::transparent)), 1).interpolableValue;
}
-void ShadowInterpolationFunctions::composite(std::unique_ptr<InterpolableValue>& underlyingInterpolableValue, RefPtr<NonInterpolableValue>& underlyingNonInterpolableValue, double underlyingFraction, const InterpolableValue& interpolableValue, const NonInterpolableValue* nonInterpolableValue)
+void ShadowInterpolationFunctions::composite(OwnPtr<InterpolableValue>& underlyingInterpolableValue, RefPtr<NonInterpolableValue>& underlyingNonInterpolableValue, double underlyingFraction, const InterpolableValue& interpolableValue, const NonInterpolableValue* nonInterpolableValue)
{
ASSERT(nonInterpolableValuesAreCompatible(underlyingNonInterpolableValue.get(), nonInterpolableValue));
InterpolableList& underlyingInterpolableList = toInterpolableList(*underlyingInterpolableValue);

Powered by Google App Engine
This is Rietveld 408576698