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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp

Issue 2765353004: Avoid inline capacity of WordMeasurements (Closed)
Patch Set: Created 3 years, 9 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 | « third_party/WebKit/Source/core/layout/LayoutBlock.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
index 05a3d2d1e043b91055bda372dfd41b54f984bc14..55223fbd5d9cf90b717ffb3a9f667f4d65add31c 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
@@ -1087,6 +1087,10 @@ void LayoutBlockFlow::layoutRunsAndFloatsInRange(
LineBreaker lineBreaker(LineLayoutBlockFlow(this));
+ // We avoid inline capacity to save the stack space.
+ WordMeasurements wordMeasurements;
+ wordMeasurements.reserveInitialCapacity(64);
+
while (!endOfLine.atEnd()) {
// The runs from the previous line should have been cleaned up.
ASSERT(!resolver.runs().runCount());
@@ -1115,7 +1119,7 @@ void LayoutBlockFlow::layoutRunsAndFloatsInRange(
FloatingObject* lastFloatFromPreviousLine =
(containsFloats()) ? m_floatingObjects->set().back().get() : 0;
- WordMeasurements wordMeasurements;
+ wordMeasurements.clear();
endOfLine = lineBreaker.nextLineBreak(resolver, layoutState.lineInfo(),
layoutTextInfo, wordMeasurements);
layoutTextInfo.m_lineBreakIterator.resetPriorContext();
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698