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

Unified Diff: Source/core/svg/SVGFontData.h

Issue 216563002: [SVG Fonts] Fix <font-face> element leak document (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 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
« no previous file with comments | « Source/core/rendering/svg/SVGTextRunRenderingContext.cpp ('k') | Source/core/svg/SVGFontData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGFontData.h
diff --git a/Source/core/svg/SVGFontData.h b/Source/core/svg/SVGFontData.h
index 8d4483fbfd7db70acd5823efcc19922a73f79bf2..7a59dc3d95a573ac13e6fe53be30c4bcedf41881 100644
--- a/Source/core/svg/SVGFontData.h
+++ b/Source/core/svg/SVGFontData.h
@@ -22,6 +22,7 @@
#if ENABLE(SVG_FONTS)
#include "platform/fonts/CustomFontData.h"
+#include "wtf/WeakPtr.h"
#include "wtf/text/WTFString.h"
namespace WebCore {
@@ -37,16 +38,16 @@ public:
return adoptRef(new SVGFontData(element));
}
- virtual ~SVGFontData() { }
+ virtual ~SVGFontData();
virtual bool isSVGFont() const OVERRIDE { return true; };
+ virtual bool shouldSkipDrawing() const OVERRIDE;
virtual void initializeFontData(SimpleFontData*, float fontSize) OVERRIDE;
virtual float widthForSVGGlyph(Glyph, float fontSize) const OVERRIDE;
virtual bool fillSVGGlyphPage(GlyphPage*, unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData*) const OVERRIDE;
virtual bool applySVGGlyphSelection(WidthIterator&, GlyphData&, bool mirror, int currentCharacter, unsigned& advanceLength) const OVERRIDE;
-
- SVGFontFaceElement* svgFontFaceElement() const { return m_svgFontFaceElement; }
+ SVGFontFaceElement* svgFontFaceElement() const;
float horizontalOriginX() const { return m_horizontalOriginX; }
float horizontalOriginY() const { return m_horizontalOriginY; }
@@ -70,7 +71,7 @@ private:
// 2) in the in-document font case: by virtue of being in the document tree and making sure that when it is removed
// from the document, it removes the @font-face rule it owns from the document's mapped element sheet and forces
// a style update.
- SVGFontFaceElement* m_svgFontFaceElement;
+ WeakPtr<SVGFontFaceElement> m_svgFontFaceElement;
float m_horizontalOriginX;
float m_horizontalOriginY;
« no previous file with comments | « Source/core/rendering/svg/SVGTextRunRenderingContext.cpp ('k') | Source/core/svg/SVGFontData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698