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

Unified Diff: third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.h

Issue 1871393003: Don't persist the SVGTextLayoutAttributesBuilder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: explicit Created 4 years, 8 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/layout/svg/SVGTextLayoutAttributesBuilder.h
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.h b/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.h
index 817a3e056b5622668b3a4e6977dbc369c64d7db7..e09cf19f3ea64e9ff0d42e277c92d5e2807626df 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.h
+++ b/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.h
@@ -24,12 +24,10 @@
#include "platform/heap/Handle.h"
#include "wtf/Allocator.h"
#include "wtf/Vector.h"
-#include "wtf/text/Unicode.h"
namespace blink {
class LayoutBoxModelObject;
-class LayoutSVGInlineText;
class LayoutSVGText;
class SVGTextPositioningElement;
@@ -40,18 +38,13 @@ class SVGTextPositioningElement;
// The first layout phase only extracts the relevant information needed in LayoutBlockFlowLine
// to create the InlineBox tree based on text chunk boundaries & BiDi information.
// The second layout phase is carried out by SVGTextLayoutEngine.
-
class SVGTextLayoutAttributesBuilder {
- DISALLOW_NEW();
+ STACK_ALLOCATED();
WTF_MAKE_NONCOPYABLE(SVGTextLayoutAttributesBuilder);
public:
- SVGTextLayoutAttributesBuilder();
-
- void buildLayoutAttributesForTextRoot(LayoutSVGText&);
+ explicit SVGTextLayoutAttributesBuilder(LayoutSVGText&);
- // Invoked whenever the underlying DOM tree changes, so that m_textPositions is rebuild.
- void clearTextPositioningElements() { m_textPositions.clear(); }
- unsigned numberOfTextPositioningElements() const { return m_textPositions.size(); }
+ void buildLayoutAttributes();
struct TextPosition {
DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
@@ -76,9 +69,9 @@ private:
void collectTextPositioningElements(LayoutBoxModelObject&);
void fillCharacterDataMap(const TextPosition&);
-private:
+ LayoutSVGText& m_textRoot;
unsigned m_characterCount;
- PersistentHeapVector<TextPosition> m_textPositions;
+ HeapVector<TextPosition> m_textPositions;
SVGCharacterDataMap m_characterDataMap;
};

Powered by Google App Engine
This is Rietveld 408576698