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

Unified Diff: Source/core/rendering/RenderGrid.cpp

Issue 653053002: Oilpan: fix build after r183657. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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/rendering/RenderGrid.cpp
diff --git a/Source/core/rendering/RenderGrid.cpp b/Source/core/rendering/RenderGrid.cpp
index f23c028d3a6118a0a1ab80960942addb5ba41298..a459c51506629a0765ae64109fd4ab4de0e1b92e 100644
--- a/Source/core/rendering/RenderGrid.cpp
+++ b/Source/core/rendering/RenderGrid.cpp
@@ -33,6 +33,7 @@
#include "core/rendering/style/GridCoordinate.h"
#include "core/rendering/style/RenderStyle.h"
#include "platform/LengthFunctions.h"
+#include "wtf/VectorTraits.h"
namespace blink {
@@ -172,6 +173,7 @@ private:
struct RenderGrid::GridSizingData {
WTF_MAKE_NONCOPYABLE(GridSizingData);
+ STACK_ALLOCATED();
public:
GridSizingData(size_t gridColumnCount, size_t gridRowCount)
: columnTracks(gridColumnCount)
@@ -186,7 +188,7 @@ public:
// Performance optimization: hold onto these Vectors until the end of Layout to avoid repeated malloc / free.
Vector<LayoutUnit> distributeTrackVector;
Vector<GridTrack*> filteredTracks;
- Vector<GridItemWithSpan> itemsSortedByIncreasingSpan;
+ WillBeHeapVector<GridItemWithSpan> itemsSortedByIncreasingSpan;
};
RenderGrid::RenderGrid(Element* element)
@@ -668,6 +670,7 @@ LayoutUnit RenderGrid::maxContentForChild(RenderBox& child, GridTrackSizingDirec
// std::pair<RenderBox*, size_t> does not work either because we still need the GridCoordinate so we'd have to add an
// extra hash lookup for each item at the beginning of RenderGrid::resolveContentBasedTrackSizingFunctionsForItems().
class GridItemWithSpan {
+ ALLOW_ONLY_INLINE_ALLOCATION();
public:
GridItemWithSpan(RenderBox& gridItem, const GridCoordinate& coordinate, GridTrackSizingDirection direction)
: m_gridItem(gridItem)
@@ -682,12 +685,33 @@ public:
bool operator<(const GridItemWithSpan other) const { return m_span < other.m_span; }
+ void trace(Visitor* visitor)
+ {
+ visitor->trace(m_gridItem);
+ }
+
private:
RawPtrWillBeMember<RenderBox> m_gridItem;
GridCoordinate m_coordinate;
size_t m_span;
};
+} // namespace blink
+
+namespace WTF {
+
+template<>
+struct VectorTraits<blink::GridItemWithSpan> : SimpleClassVectorTraits<blink::GridItemWithSpan> {
+ // needsDestruction is by default defined in terms of IsPod<>, but as
+ // it doesn't handle embedded structs/enums (e.g., GridCoordinate),
+ // override it here.
+ static const bool needsDestruction = false;
+};
haraken 2014/10/14 11:41:30 Can't we use WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS ins
sof 2014/10/14 11:47:21 Same as for GradientStop, the reason why not is th
+
+} // namespace WTF
+
+namespace blink {
+
void RenderGrid::resolveContentBasedTrackSizingFunctions(GridTrackSizingDirection direction, GridSizingData& sizingData, LayoutUnit& availableLogicalSpace)
{
sizingData.itemsSortedByIncreasingSpan.shrink(0);
« 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