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

Unified Diff: Source/WebCore/dom/Document.cpp

Issue 7932007: Merge 94508 - <rdar://problem/10071256> Retain retired custom fonts until the next style recalc (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 3 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/WebCore/dom/Document.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/dom/Document.cpp
===================================================================
--- Source/WebCore/dom/Document.cpp (revision 95343)
+++ Source/WebCore/dom/Document.cpp (working copy)
@@ -546,6 +546,8 @@
(*m_pageGroupUserSheets)[i]->clearOwnerNode();
}
+ deleteRetiredCustomFonts();
+
m_weakReference->clear();
if (m_mediaQueryMatcher)
@@ -1528,6 +1530,9 @@
if (change >= Inherit || n->childNeedsStyleRecalc() || n->needsStyleRecalc())
n->recalcStyle(change);
+ // Now that all RenderStyles that pointed to retired fonts have been updated, the fonts can safely be deleted.
+ deleteRetiredCustomFonts();
+
#if USE(ACCELERATED_COMPOSITING)
if (view()) {
bool layoutPending = view()->layoutPending() || renderer()->needsLayout();
@@ -1664,6 +1669,20 @@
return style.release();
}
+void Document::retireCustomFont(FontData* fontData)
+{
+ m_retiredCustomFonts.append(adoptPtr(fontData));
+}
+
+void Document::deleteRetiredCustomFonts()
+{
+ size_t size = m_retiredCustomFonts.size();
+ for (size_t i = 0; i < size; ++i)
+ GlyphPageTreeNode::pruneTreeCustomFontData(m_retiredCustomFonts[i].get());
+
+ m_retiredCustomFonts.clear();
+}
+
bool Document::isPageBoxVisible(int pageIndex)
{
RefPtr<RenderStyle> style = styleForPage(pageIndex);
« no previous file with comments | « Source/WebCore/dom/Document.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698