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

Unified Diff: Source/core/css/CSSGradientValue.cpp

Issue 642843002: Oilpan: fix build after r183460. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use ALLOW_ONLY_INLINE_ALLOCATION() Created 6 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSGradientValue.cpp
diff --git a/Source/core/css/CSSGradientValue.cpp b/Source/core/css/CSSGradientValue.cpp
index 59aa9420fd79ba6fd62225e48583cc729b9cc689..7830aeae52f7f0f0a41d2781cb1704b6bd4c4654 100644
--- a/Source/core/css/CSSGradientValue.cpp
+++ b/Source/core/css/CSSGradientValue.cpp
@@ -101,7 +101,9 @@ void CSSGradientValue::sortStopsIfNeeded()
}
}
-struct GradientStop {
+class GradientStop {
+ ALLOW_ONLY_INLINE_ALLOCATION();
sof 2014/10/09 15:10:36 We could leave this out, not sure it is worth it.
sof 2014/10/09 15:32:20 Landing now to heal the tree. If preferable withou
+public:
Color color;
float offset;
bool specified;
@@ -112,6 +114,22 @@ struct GradientStop {
{ }
};
+} // namespace blink
+
+// Escape out and declare VectorTraits for GradientStop before it is used
+// in a HeapVector with an inline capacity.
+namespace WTF {
+
+template<>
+struct VectorTraits<blink::GradientStop> : SimpleClassVectorTraits<blink::GradientStop> {
haraken 2014/10/09 15:05:35 Can we use WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS inste
sof 2014/10/09 15:10:36 The needsDestruction override is needed, unfortuna
+ // IsPod<> doesn't handle embedded structs/enums (e.g., Color.)
+ static const bool needsDestruction = false;
+};
+
+} // namespace WTF
+
+namespace blink {
+
PassRefPtrWillBeRawPtr<CSSGradientValue> CSSGradientValue::gradientWithStylesResolved(const TextLinkColors& textLinkColors, Color currentColor)
{
bool derived = false;
@@ -143,7 +161,7 @@ PassRefPtrWillBeRawPtr<CSSGradientValue> CSSGradientValue::gradientWithStylesRes
return result.release();
}
-static void replaceColorHintsWithColorStops(Vector<GradientStop>& stops, const Vector<CSSGradientColorStop, 2>& cssGradientStops)
+static void replaceColorHintsWithColorStops(WillBeHeapVector<GradientStop>& stops, const WillBeHeapVector<CSSGradientColorStop, 2>& cssGradientStops)
{
// This algorithm will replace each color interpolation hint with 9 regular
// color stops. The color values for the new color stops will be calculated
@@ -253,7 +271,7 @@ void CSSGradientValue::addStops(Gradient* gradient, const CSSToLengthConversionD
size_t numStops = m_stops.size();
- Vector<GradientStop> stops(numStops);
+ WillBeHeapVector<GradientStop> stops(numStops);
float gradientLength = 0;
bool computedGradientLength = false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698