<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[178250] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/178250">178250</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2015-01-11 14:58:09 -0800 (Sun, 11 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove FontCachePurgePreventer
https://bugs.webkit.org/show_bug.cgi?id=139628

Reviewed by Anders Carlsson.

This stack type is bug prone and invasive. A missing FontCachePurgePreventer in a code that touches fonts is always
a hard-to-detect bug and there are many places that need it. Instead purge the font cache on top of the runloop.

The purge timer could in principle fire in a nested runloop. However we should never have unreferenced
SimpleFontData objects in the stack in such case (GlyphData objects don't currently ref the font) because those
only occur during layout and painting. Layout and painting can't trigger a nested runloops as there would be
bigger problems.

Purging may also be triggered synchronously by a memory notification. That case won't have any GlyphDatas in the stack either.

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::measureText):
(WebCore::CanvasRenderingContext2D::drawTextInternal):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::paintContents):
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::FontCache):
(WebCore::FontCache::fontForFamily):
(WebCore::FontCache::purgeTimerFired):
(WebCore::FontCache::purgeInactiveFontData):
* platform/graphics/FontCache.h:
(WebCore::FontCache::disablePurging): Deleted.
(WebCore::FontCache::enablePurging): Deleted.
(WebCore::FontCachePurgePreventer::FontCachePurgePreventer): Deleted.
(WebCore::FontCachePurgePreventer::~FontCachePurgePreventer): Deleted.
* platform/graphics/FontFastPath.cpp:
(WebCore::Font::emphasisMarkAscent):
(WebCore::Font::emphasisMarkDescent):
(WebCore::Font::emphasisMarkHeight):
(WebCore::Font::drawEmphasisMarks):
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
(PlatformCALayerWinInternal::displayCallback):
* platform/mac/DragImageMac.mm:
(WebCore::widthWithFont):
(WebCore::drawAtPoint):
(WebCore::createDragImageForLink):
* platform/win/DragImageWin.cpp:
(WebCore::createDragImageForLink):
* platform/win/WebCoreTextRenderer.cpp:
(WebCore::doDrawTextAtPoint):
(WebCore::WebCoreTextFloatWidth):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::localSelectionRect):
(WebCore::InlineTextBox::offsetForPosition):
(WebCore::InlineTextBox::positionForOffset):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::setImageSizeForAltText):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintIntoLayer):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::updateFromElement):
(WebCore::RenderListBox::paintItemForeground):
* rendering/RenderMenuList.cpp:
(RenderMenuList::updateOptionsWidth):
* rendering/RenderThemeIOS.mm:
(WebCore::adjustInputElementButtonStyle):
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::updateStyle):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::subtreeChildWasAdded):
(WebCore::RenderSVGText::subtreeStyleDidChange):
(WebCore::RenderSVGText::subtreeTextDidChange):
(WebCore::RenderSVGText::removeChild):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::selectionRectForTextFragment):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp">trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCachecpp">trunk/Source/WebCore/platform/graphics/FontCache.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCacheh">trunk/Source/WebCore/platform/graphics/FontCache.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontFastPathcpp">trunk/Source/WebCore/platform/graphics/FontFastPath.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWinInternalcpp">trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmacDragImageMacmm">trunk/Source/WebCore/platform/mac/DragImageMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformwinDragImageWincpp">trunk/Source/WebCore/platform/win/DragImageWin.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformwinWebCoreTextRenderercpp">trunk/Source/WebCore/platform/win/WebCoreTextRenderer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineTextBoxcpp">trunk/Source/WebCore/rendering/InlineTextBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderImagecpp">trunk/Source/WebCore/rendering/RenderImage.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerBackingcpp">trunk/Source/WebCore/rendering/RenderLayerBacking.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderListBoxcpp">trunk/Source/WebCore/rendering/RenderListBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderMenuListcpp">trunk/Source/WebCore/rendering/RenderMenuList.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeIOSmm">trunk/Source/WebCore/rendering/RenderThemeIOS.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLOperatorcpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGTextcpp">trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGInlineTextBoxcpp">trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp</a></li>
<li><a href="#trunkSourceWebKitmacMiscWebKitNSStringExtrasmm">trunk/Source/WebKit/mac/Misc/WebKitNSStringExtras.mm</a></li>
<li><a href="#trunkSourceWebKitmacMiscWebStringTruncatormm">trunk/Source/WebKit/mac/Misc/WebStringTruncator.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebHTMLViewmm">trunk/Source/WebKit/mac/WebView/WebHTMLView.mm</a></li>
<li><a href="#trunkSourceWebKitwinWebKitGraphicscpp">trunk/Source/WebKit/win/WebKitGraphics.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebCore/ChangeLog        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -1,3 +1,77 @@
</span><ins>+2015-01-11  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        Remove FontCachePurgePreventer
+        https://bugs.webkit.org/show_bug.cgi?id=139628
+
+        Reviewed by Anders Carlsson.
+
+        This stack type is bug prone and invasive. A missing FontCachePurgePreventer in a code that touches fonts is always
+        a hard-to-detect bug and there are many places that need it. Instead purge the font cache on top of the runloop.
+
+        The purge timer could in principle fire in a nested runloop. However we should never have unreferenced
+        SimpleFontData objects in the stack in such case (GlyphData objects don't currently ref the font) because those
+        only occur during layout and painting. Layout and painting can't trigger a nested runloops as there would be
+        bigger problems.
+
+        Purging may also be triggered synchronously by a memory notification. That case won't have any GlyphDatas in the stack either.
+
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::measureText):
+        (WebCore::CanvasRenderingContext2D::drawTextInternal):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::layout):
+        (WebCore::FrameView::paintContents):
+        * platform/graphics/FontCache.cpp:
+        (WebCore::FontCache::FontCache):
+        (WebCore::FontCache::fontForFamily):
+        (WebCore::FontCache::purgeTimerFired):
+        (WebCore::FontCache::purgeInactiveFontData):
+        * platform/graphics/FontCache.h:
+        (WebCore::FontCache::disablePurging): Deleted.
+        (WebCore::FontCache::enablePurging): Deleted.
+        (WebCore::FontCachePurgePreventer::FontCachePurgePreventer): Deleted.
+        (WebCore::FontCachePurgePreventer::~FontCachePurgePreventer): Deleted.
+        * platform/graphics/FontFastPath.cpp:
+        (WebCore::Font::emphasisMarkAscent):
+        (WebCore::Font::emphasisMarkDescent):
+        (WebCore::Font::emphasisMarkHeight):
+        (WebCore::Font::drawEmphasisMarks):
+        * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
+        (PlatformCALayerWinInternal::displayCallback):
+        * platform/mac/DragImageMac.mm:
+        (WebCore::widthWithFont):
+        (WebCore::drawAtPoint):
+        (WebCore::createDragImageForLink):
+        * platform/win/DragImageWin.cpp:
+        (WebCore::createDragImageForLink):
+        * platform/win/WebCoreTextRenderer.cpp:
+        (WebCore::doDrawTextAtPoint):
+        (WebCore::WebCoreTextFloatWidth):
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::localSelectionRect):
+        (WebCore::InlineTextBox::offsetForPosition):
+        (WebCore::InlineTextBox::positionForOffset):
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::setImageSizeForAltText):
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::paintIntoLayer):
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::updateFromElement):
+        (WebCore::RenderListBox::paintItemForeground):
+        * rendering/RenderMenuList.cpp:
+        (RenderMenuList::updateOptionsWidth):
+        * rendering/RenderThemeIOS.mm:
+        (WebCore::adjustInputElementButtonStyle):
+        * rendering/mathml/RenderMathMLOperator.cpp:
+        (WebCore::RenderMathMLOperator::updateStyle):
+        * rendering/svg/RenderSVGText.cpp:
+        (WebCore::RenderSVGText::subtreeChildWasAdded):
+        (WebCore::RenderSVGText::subtreeStyleDidChange):
+        (WebCore::RenderSVGText::subtreeTextDidChange):
+        (WebCore::RenderSVGText::removeChild):
+        * rendering/svg/SVGInlineTextBox.cpp:
+        (WebCore::SVGInlineTextBox::selectionRectForTextFragment):
+
</ins><span class="cx"> 2015-01-11  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [SVG -&gt; OTF Converter] Implement ligatures
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -42,7 +42,6 @@
</span><span class="cx"> #include &quot;DOMPath.h&quot;
</span><span class="cx"> #include &quot;ExceptionCodePlaceholder.h&quot;
</span><span class="cx"> #include &quot;FloatQuad.h&quot;
</span><del>-#include &quot;FontCache.h&quot;
</del><span class="cx"> #include &quot;GraphicsContext.h&quot;
</span><span class="cx"> #include &quot;HTMLImageElement.h&quot;
</span><span class="cx"> #include &quot;HTMLVideoElement.h&quot;
</span><span class="lines">@@ -2257,8 +2256,6 @@
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;TextMetrics&gt; CanvasRenderingContext2D::measureText(const String&amp; text)
</span><span class="cx"> {
</span><del>-    FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">     RefPtr&lt;TextMetrics&gt; metrics = TextMetrics::create();
</span><span class="cx"> 
</span><span class="cx">     String normalizedText = text;
</span><span class="lines">@@ -2290,8 +2287,6 @@
</span><span class="cx">     if (fill &amp;&amp; gradient &amp;&amp; gradient-&gt;isZeroSize())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">     const Font&amp; font = accessFont();
</span><span class="cx">     const FontMetrics&amp; fontMetrics = font.fontMetrics();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebCore/page/FrameView.cpp        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -40,7 +40,6 @@
</span><span class="cx"> #include &quot;EventHandler.h&quot;
</span><span class="cx"> #include &quot;FloatRect.h&quot;
</span><span class="cx"> #include &quot;FocusController.h&quot;
</span><del>-#include &quot;FontCache.h&quot;
</del><span class="cx"> #include &quot;FontLoader.h&quot;
</span><span class="cx"> #include &quot;FrameLoader.h&quot;
</span><span class="cx"> #include &quot;FrameLoaderClient.h&quot;
</span><span class="lines">@@ -1222,7 +1221,6 @@
</span><span class="cx">         // The next block sets m_layoutSchedulingEnabled back to false once again.
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    FontCachePurgePreventer fontCachePurgePreventer;
</del><span class="cx">     RenderLayer* layer;
</span><span class="cx"> 
</span><span class="cx">     ++m_nestedLayoutCount;
</span><span class="lines">@@ -3846,8 +3844,6 @@
</span><span class="cx">     PaintingState paintingState;
</span><span class="cx">     willPaintContents(context, dirtyRect, paintingState);
</span><span class="cx"> 
</span><del>-    FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">     // m_nodeToDraw is used to draw only one element (and its descendants)
</span><span class="cx">     RenderObject* renderer = m_nodeToDraw ? m_nodeToDraw-&gt;renderer() : nullptr;
</span><span class="cx">     RenderLayer* rootLayer = renderView-&gt;layer();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontCache.cpp (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCache.cpp        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebCore/platform/graphics/FontCache.cpp        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> FontCache::FontCache()
</span><del>-    : m_purgePreventCount(0)
</del><ins>+    : m_purgeTimer(*this, &amp;FontCache::purgeTimerFired)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -372,7 +372,7 @@
</span><span class="cx"> const int cMaxInactiveFontData = 120;
</span><span class="cx"> const int cTargetInactiveFontData = 100;
</span><span class="cx"> #else
</span><del>-const int cMaxInactiveFontData = 225;
</del><ins>+const int cMaxInactiveFontData = 5;
</ins><span class="cx"> const int cTargetInactiveFontData = 200;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -381,6 +381,9 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;SimpleFontData&gt; FontCache::fontForFamily(const FontDescription&amp; fontDescription, const AtomicString&amp; family, bool checkingAlternateName)
</span><span class="cx"> {
</span><ins>+    if (!m_purgeTimer.isActive())
+        m_purgeTimer.startOneShot(std::chrono::milliseconds::zero());
+
</ins><span class="cx">     FontPlatformData* platformData = getCachedFontPlatformData(fontDescription, family, checkingAlternateName);
</span><span class="cx">     if (!platformData)
</span><span class="cx">         return nullptr;
</span><span class="lines">@@ -401,6 +404,11 @@
</span><span class="cx">     return *addResult.iterator-&gt;value;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void FontCache::purgeTimerFired()
+{
+    purgeInactiveFontDataIfNeeded();
+}
+
</ins><span class="cx"> void FontCache::purgeInactiveFontDataIfNeeded()
</span><span class="cx"> {
</span><span class="cx">     bool underMemoryPressure = memoryPressureHandler().isUnderMemoryPressure();
</span><span class="lines">@@ -420,9 +428,6 @@
</span><span class="cx"> {
</span><span class="cx">     pruneUnreferencedEntriesFromFontGlyphsCache();
</span><span class="cx"> 
</span><del>-    if (m_purgePreventCount)
-        return;
-
</del><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     FontLocker fontLocker;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontCache.h (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCache.h        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebCore/platform/graphics/FontCache.h        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #define FontCache_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;FontDescription.h&quot;
</span><ins>+#include &quot;Timer.h&quot;
</ins><span class="cx"> #include &lt;limits.h&gt;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/PassRefPtr.h&gt;
</span><span class="lines">@@ -103,7 +104,6 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class FontCache {
</span><del>-    friend class FontCachePurgePreventer;
</del><span class="cx">     friend class WTF::NeverDestroyed&lt;FontCache&gt;;
</span><span class="cx"> 
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(FontCache); WTF_MAKE_FAST_ALLOCATED;
</span><span class="lines">@@ -163,15 +163,9 @@
</span><span class="cx">     FontCache();
</span><span class="cx">     ~FontCache();
</span><span class="cx"> 
</span><del>-    void disablePurging() { m_purgePreventCount++; }
-    void enablePurging()
-    {
-        ASSERT(m_purgePreventCount);
-        if (!--m_purgePreventCount)
-            purgeInactiveFontDataIfNeeded();
-    }
</del><ins>+    void purgeTimerFired();
</ins><span class="cx"> 
</span><del>-    void WEBCORE_EXPORT purgeInactiveFontDataIfNeeded();
</del><ins>+    void purgeInactiveFontDataIfNeeded();
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: This method should eventually be removed.
</span><span class="cx">     FontPlatformData* getCachedFontPlatformData(const FontDescription&amp;, const AtomicString&amp; family, bool checkingAlternateName = false);
</span><span class="lines">@@ -183,8 +177,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     std::unique_ptr&lt;FontPlatformData&gt; createFontPlatformData(const FontDescription&amp;, const AtomicString&amp; family);
</span><span class="cx"> 
</span><del>-    // Don't purge if this count is &gt; 0;
-    int m_purgePreventCount;
</del><ins>+    Timer m_purgeTimer;
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     friend class ComplexTextController;
</span><span class="lines">@@ -195,12 +188,6 @@
</span><span class="cx"> // Get the global fontCache.
</span><span class="cx"> WEBCORE_EXPORT FontCache&amp; fontCache();
</span><span class="cx"> 
</span><del>-class FontCachePurgePreventer {
-public:
-    FontCachePurgePreventer() { fontCache().disablePurging(); }
-    ~FontCachePurgePreventer() { fontCache().enablePurging(); }
-};
-
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontFastPathcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontFastPath.cpp (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontFastPath.cpp        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebCore/platform/graphics/FontFastPath.cpp        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -24,7 +24,6 @@
</span><span class="cx"> #include &quot;Font.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;FloatRect.h&quot;
</span><del>-#include &quot;FontCache.h&quot;
</del><span class="cx"> #include &quot;FontGlyphs.h&quot;
</span><span class="cx"> #include &quot;GlyphBuffer.h&quot;
</span><span class="cx"> #include &quot;LayoutRect.h&quot;
</span><span class="lines">@@ -69,8 +68,6 @@
</span><span class="cx"> 
</span><span class="cx"> int Font::emphasisMarkAscent(const AtomicString&amp; mark) const
</span><span class="cx"> {
</span><del>-    FontCachePurgePreventer purgePreventer;
-    
</del><span class="cx">     GlyphData markGlyphData;
</span><span class="cx">     if (!getEmphasisMarkGlyphData(mark, markGlyphData))
</span><span class="cx">         return 0;
</span><span class="lines">@@ -85,8 +82,6 @@
</span><span class="cx"> 
</span><span class="cx"> int Font::emphasisMarkDescent(const AtomicString&amp; mark) const
</span><span class="cx"> {
</span><del>-    FontCachePurgePreventer purgePreventer;
-    
</del><span class="cx">     GlyphData markGlyphData;
</span><span class="cx">     if (!getEmphasisMarkGlyphData(mark, markGlyphData))
</span><span class="cx">         return 0;
</span><span class="lines">@@ -101,8 +96,6 @@
</span><span class="cx"> 
</span><span class="cx"> int Font::emphasisMarkHeight(const AtomicString&amp; mark) const
</span><span class="cx"> {
</span><del>-    FontCachePurgePreventer purgePreventer;
-
</del><span class="cx">     GlyphData markGlyphData;
</span><span class="cx">     if (!getEmphasisMarkGlyphData(mark, markGlyphData))
</span><span class="cx">         return 0;
</span><span class="lines">@@ -240,8 +233,6 @@
</span><span class="cx"> 
</span><span class="cx"> void Font::drawEmphasisMarks(GraphicsContext* context, const TextRun&amp; run, const GlyphBuffer&amp; glyphBuffer, const AtomicString&amp; mark, const FloatPoint&amp; point) const
</span><span class="cx"> {
</span><del>-    FontCachePurgePreventer purgePreventer;
-    
</del><span class="cx">     GlyphData markGlyphData;
</span><span class="cx">     if (!getEmphasisMarkGlyphData(mark, markGlyphData))
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWinInternalcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> #include &quot;PlatformCALayerWinInternal.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Font.h&quot;
</span><del>-#include &quot;FontCache.h&quot;
</del><span class="cx"> #include &quot;GraphicsContext.h&quot;
</span><span class="cx"> #include &quot;PlatformCALayer.h&quot;
</span><span class="cx"> #include &quot;TextRun.h&quot;
</span><span class="lines">@@ -131,8 +130,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     if (owner()-&gt;owner()-&gt;platformCALayerShowRepaintCounter(owner())) {
</span><del>-        FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">         String text = String::number(owner()-&gt;owner()-&gt;platformCALayerIncrementRepaintCount(owner()));
</span><span class="cx"> 
</span><span class="cx">         CGContextSaveGState(context);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacDragImageMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/DragImageMac.mm (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/DragImageMac.mm        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebCore/platform/mac/DragImageMac.mm        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><span class="cx"> #import &quot;BitmapImage.h&quot;
</span><span class="cx"> #import &quot;Font.h&quot;
</span><del>-#import &quot;FontCache.h&quot;
</del><span class="cx"> #import &quot;FontDescription.h&quot;
</span><span class="cx"> #import &quot;FontSelector.h&quot;
</span><span class="cx"> #import &quot;GraphicsContext.h&quot;
</span><span class="lines">@@ -192,8 +191,6 @@
</span><span class="cx">     [string getCharacters:buffer.data()];
</span><span class="cx">     
</span><span class="cx">     if (canUseFastRenderer(buffer.data(), length)) {
</span><del>-        FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">         Font webCoreFont(FontPlatformData(font, [font pointSize]), ![[NSGraphicsContext currentContext] isDrawingToScreen]);
</span><span class="cx">         TextRun run(buffer.data(), length);
</span><span class="cx">         run.disableRoundingHacks();
</span><span class="lines">@@ -218,8 +215,6 @@
</span><span class="cx">     [string getCharacters:buffer.data()];
</span><span class="cx">     
</span><span class="cx">     if (canUseFastRenderer(buffer.data(), length)) {
</span><del>-        FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">         // The following is a half-assed attempt to match AppKit's rounding rules for drawAtPoint.
</span><span class="cx">         // It's probably incorrect for high DPI.
</span><span class="cx">         // If you change this, be sure to test all the text drawn this way in Safari, including
</span><span class="lines">@@ -272,8 +267,6 @@
</span><span class="cx"> 
</span><span class="cx"> DragImageRef createDragImageForLink(URL&amp; url, const String&amp; title, FontRenderingMode)
</span><span class="cx"> {
</span><del>-    FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">     NSString *label = nsStringNilIfEmpty(title);
</span><span class="cx">     NSURL *cocoaURL = url;
</span><span class="cx">     NSString *urlString = [cocoaURL absoluteString];
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformwinDragImageWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/win/DragImageWin.cpp (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/win/DragImageWin.cpp        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebCore/platform/win/DragImageWin.cpp        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;FloatRoundedRect.h&quot;
</span><span class="cx"> #include &quot;Font.h&quot;
</span><del>-#include &quot;FontCache.h&quot;
</del><span class="cx"> #include &quot;FontDescription.h&quot;
</span><span class="cx"> #include &quot;FontSelector.h&quot;
</span><span class="cx"> #include &quot;GraphicsContext.h&quot;
</span><span class="lines">@@ -126,7 +125,6 @@
</span><span class="cx"> 
</span><span class="cx">     const Font* labelFont;
</span><span class="cx">     const Font* urlFont;
</span><del>-    FontCachePurgePreventer fontCachePurgePreventer;
</del><span class="cx"> 
</span><span class="cx">     if (fontRenderingMode == AlternateRenderingMode) {
</span><span class="cx">         static const Font alternateRenderingModeLabelFont = dragLabelFont(DragLinkLabelFontsize, true, AlternateRenderingMode);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformwinWebCoreTextRenderercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/win/WebCoreTextRenderer.cpp (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/win/WebCoreTextRenderer.cpp        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebCore/platform/win/WebCoreTextRenderer.cpp        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> #include &quot;WebCoreTextRenderer.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Font.h&quot;
</span><del>-#include &quot;FontCache.h&quot;
</del><span class="cx"> #include &quot;FontDescription.h&quot;
</span><span class="cx"> #include &quot;GraphicsContext.h&quot;
</span><span class="cx"> #include &quot;StringTruncator.h&quot;
</span><span class="lines">@@ -48,8 +47,6 @@
</span><span class="cx"> 
</span><span class="cx"> static void doDrawTextAtPoint(GraphicsContext&amp; context, const String&amp; text, const IntPoint&amp; point, const Font&amp; font, const Color&amp; color, int underlinedIndex)
</span><span class="cx"> {
</span><del>-    FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">     TextRun run(text);
</span><span class="cx"> 
</span><span class="cx">     context.setFillColor(color, ColorSpaceDeviceRGB);
</span><span class="lines">@@ -94,8 +91,6 @@
</span><span class="cx"> 
</span><span class="cx"> float WebCoreTextFloatWidth(const String&amp; text, const Font&amp; font)
</span><span class="cx"> {
</span><del>-    FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">     return StringTruncator::width(text, font, StringTruncator::EnableRoundingHacks);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineTextBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineTextBox.cpp        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> #include &quot;DocumentMarkerController.h&quot;
</span><span class="cx"> #include &quot;Editor.h&quot;
</span><span class="cx"> #include &quot;EllipsisBox.h&quot;
</span><del>-#include &quot;FontCache.h&quot;
</del><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;GraphicsContext.h&quot;
</span><span class="cx"> #include &quot;HitTestResult.h&quot;
</span><span class="lines">@@ -264,8 +263,6 @@
</span><span class="cx">     if (sPos &gt; ePos)
</span><span class="cx">         return LayoutRect();
</span><span class="cx"> 
</span><del>-    FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">     LayoutUnit selectionTop = this-&gt;selectionTop();
</span><span class="cx">     LayoutUnit selectionHeight = this-&gt;selectionHeight();
</span><span class="cx">     const RenderStyle&amp; lineStyle = this-&gt;lineStyle();
</span><span class="lines">@@ -1331,8 +1328,6 @@
</span><span class="cx">     if (lineOffset - logicalLeft() &lt; 0)
</span><span class="cx">         return isLeftToRightDirection() ? 0 : len();
</span><span class="cx"> 
</span><del>-    FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">     const RenderStyle&amp; lineStyle = this-&gt;lineStyle();
</span><span class="cx">     const Font&amp; font = fontToUse(lineStyle, renderer());
</span><span class="cx">     return font.offsetForPosition(constructTextRun(lineStyle, font), lineOffset - logicalLeft(), includePartialGlyphs);
</span><span class="lines">@@ -1346,8 +1341,6 @@
</span><span class="cx">     if (isLineBreak())
</span><span class="cx">         return logicalLeft();
</span><span class="cx"> 
</span><del>-    FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">     const RenderStyle&amp; lineStyle = this-&gt;lineStyle();
</span><span class="cx">     const Font&amp; font = fontToUse(lineStyle, renderer());
</span><span class="cx">     int from = !isLeftToRightDirection() ? offset - m_start : 0;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderImage.cpp (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderImage.cpp        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebCore/rendering/RenderImage.cpp        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -192,8 +192,6 @@
</span><span class="cx"> 
</span><span class="cx">     // we have an alt and the user meant it (its not a text we invented)
</span><span class="cx">     if (!m_altText.isEmpty()) {
</span><del>-        FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">         const Font&amp; font = style().font();
</span><span class="cx">         IntSize paddedTextSize(paddingWidth + std::min(ceilf(font.width(RenderBlock::constructTextRun(this, font, m_altText, style()))), maxAltTextWidth), paddingHeight + std::min(font.fontMetrics().height(), maxAltTextHeight));
</span><span class="cx">         imageSize = imageSize.expandedTo(paddedTextSize);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerBackingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -33,7 +33,6 @@
</span><span class="cx"> #include &quot;CachedImage.h&quot;
</span><span class="cx"> #include &quot;Chrome.h&quot;
</span><span class="cx"> #include &quot;FilterEffectRenderer.h&quot;
</span><del>-#include &quot;FontCache.h&quot;
</del><span class="cx"> #include &quot;FrameView.h&quot;
</span><span class="cx"> #include &quot;GraphicsContext.h&quot;
</span><span class="cx"> #include &quot;GraphicsLayer.h&quot;
</span><span class="lines">@@ -2185,8 +2184,6 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    FontCachePurgePreventer fontCachePurgePreventer;
-    
</del><span class="cx">     RenderLayer::PaintLayerFlags paintFlags = 0;
</span><span class="cx">     if (paintingPhase &amp; GraphicsLayerPaintBackground)
</span><span class="cx">         paintFlags |= RenderLayer::PaintLayerPaintingCompositingBackgroundPhase;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderListBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderListBox.cpp (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderListBox.cpp        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebCore/rendering/RenderListBox.cpp        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -36,7 +36,6 @@
</span><span class="cx"> #include &quot;DocumentEventQueue.h&quot;
</span><span class="cx"> #include &quot;EventHandler.h&quot;
</span><span class="cx"> #include &quot;FocusController.h&quot;
</span><del>-#include &quot;FontCache.h&quot;
</del><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;FrameSelection.h&quot;
</span><span class="cx"> #include &quot;FrameView.h&quot;
</span><span class="lines">@@ -105,8 +104,6 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderListBox::updateFromElement()
</span><span class="cx"> {
</span><del>-    FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">     if (m_optionsChanged) {
</span><span class="cx">         const Vector&lt;HTMLElement*&gt;&amp; listItems = selectElement().listItems();
</span><span class="cx">         int size = numItems();
</span><span class="lines">@@ -372,8 +369,6 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderListBox::paintItemForeground(PaintInfo&amp; paintInfo, const LayoutPoint&amp; paintOffset, int listIndex)
</span><span class="cx"> {
</span><del>-    FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">     const Vector&lt;HTMLElement*&gt;&amp; listItems = selectElement().listItems();
</span><span class="cx">     HTMLElement* listItemElement = listItems[listIndex];
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderMenuListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderMenuList.cpp (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderMenuList.cpp        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebCore/rendering/RenderMenuList.cpp        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> #include &quot;AccessibilityMenuList.h&quot;
</span><span class="cx"> #include &quot;CSSFontSelector.h&quot;
</span><span class="cx"> #include &quot;Chrome.h&quot;
</span><del>-#include &quot;FontCache.h&quot;
</del><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;FrameView.h&quot;
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="lines">@@ -209,7 +208,6 @@
</span><span class="cx">     float maxOptionWidth = 0;
</span><span class="cx">     const Vector&lt;HTMLElement*&gt;&amp; listItems = selectElement().listItems();
</span><span class="cx">     int size = listItems.size();    
</span><del>-    FontCachePurgePreventer fontCachePurgePreventer;
</del><span class="cx"> 
</span><span class="cx">     for (int i = 0; i &lt; size; ++i) {
</span><span class="cx">         HTMLElement* element = listItems[i];
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -583,7 +583,6 @@
</span><span class="cx">     if (font.primaryFontData().isSVGFont() &amp;&amp; !renderer)
</span><span class="cx">         return;
</span><span class="cx">     
</span><del>-    FontCachePurgePreventer fontCachePurgePreventer;
</del><span class="cx">     float maximumWidth = localizedDateCache().maximumWidthForDateType(dateType, font, RenderThemeMeasureTextClient(font, *renderer, style));
</span><span class="cx"> 
</span><span class="cx">     ASSERT(maximumWidth &gt;= 0);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLOperatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;RenderMathMLOperator.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;FontCache.h&quot;
</del><span class="cx"> #include &quot;FontSelector.h&quot;
</span><span class="cx"> #include &quot;MathMLNames.h&quot;
</span><span class="cx"> #include &quot;PaintInfo.h&quot;
</span><span class="lines">@@ -1659,8 +1658,6 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderMathMLOperator::updateStyle()
</span><span class="cx"> {
</span><del>-    FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">     ASSERT(firstChild());
</span><span class="cx">     if (!firstChild())
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> #include &quot;RenderSVGText.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;FloatQuad.h&quot;
</span><del>-#include &quot;FontCache.h&quot;
</del><span class="cx"> #include &quot;GraphicsContext.h&quot;
</span><span class="cx"> #include &quot;HitTestRequest.h&quot;
</span><span class="cx"> #include &quot;HitTestResult.h&quot;
</span><span class="lines">@@ -170,9 +169,6 @@
</span><span class="cx">     if (!shouldHandleSubtreeMutations() || documentBeingDestroyed())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    // Always protect the cache before clearing text positioning elements when the cache will subsequently be rebuilt.
-    FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">     // The positioning elements cache doesn't include the new 'child' yet. Clear the
</span><span class="cx">     // cache, as the next buildLayoutAttributesForTextRenderer() call rebuilds it.
</span><span class="cx">     m_layoutAttributesBuilder.clearTextPositioningElements();
</span><span class="lines">@@ -295,7 +291,6 @@
</span><span class="cx"> 
</span><span class="cx">     // Only update the metrics cache, but not the text positioning element cache
</span><span class="cx">     // nor the layout attributes cached in the leaf #text renderers.
</span><del>-    FontCachePurgePreventer fontCachePurgePreventer;
</del><span class="cx">     for (RenderObject* descendant = text; descendant; descendant = descendant-&gt;nextInPreOrder(text)) {
</span><span class="cx">         if (is&lt;RenderSVGInlineText&gt;(*descendant))
</span><span class="cx">             m_layoutAttributesBuilder.rebuildMetricsForTextRenderer(downcast&lt;RenderSVGInlineText&gt;(*descendant));
</span><span class="lines">@@ -317,9 +312,6 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    // Always protect the cache before clearing text positioning elements when the cache will subsequently be rebuilt.
-    FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">     // The positioning elements cache depends on the size of each text renderer in the
</span><span class="cx">     // subtree. If this changes, clear the cache. It's going to be rebuilt below.
</span><span class="cx">     m_layoutAttributesBuilder.clearTextPositioningElements();
</span><span class="lines">@@ -544,7 +536,6 @@
</span><span class="cx">     SVGResourcesCache::clientWillBeRemovedFromTree(child);
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;SVGTextLayoutAttributes*, 2&gt; affectedAttributes;
</span><del>-    FontCachePurgePreventer fontCachePurgePreventer;
</del><span class="cx">     subtreeChildWillBeRemoved(&amp;child, affectedAttributes);
</span><span class="cx">     RenderSVGBlock::removeChild(child);
</span><span class="cx">     subtreeChildWasRemoved(affectedAttributes);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGInlineTextBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -22,7 +22,6 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;SVGInlineTextBox.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;FontCache.h&quot;
</del><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;FrameView.h&quot;
</span><span class="cx"> #include &quot;GraphicsContext.h&quot;
</span><span class="lines">@@ -114,8 +113,6 @@
</span><span class="cx">     ASSERT_WITH_SECURITY_IMPLICATION(startPosition &lt; endPosition);
</span><span class="cx">     ASSERT(style);
</span><span class="cx"> 
</span><del>-    FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">     float scalingFactor = renderer().scalingFactor();
</span><span class="cx">     ASSERT(scalingFactor);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacMiscWebKitNSStringExtrasmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Misc/WebKitNSStringExtras.mm (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Misc/WebKitNSStringExtras.mm        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebKit/mac/Misc/WebKitNSStringExtras.mm        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> #import &quot;WebKitNSStringExtras.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #import &lt;WebCore/Font.h&gt;
</span><del>-#import &lt;WebCore/FontCache.h&gt;
</del><span class="cx"> #import &lt;WebCore/GraphicsContext.h&gt;
</span><span class="cx"> #import &lt;WebCore/TextRun.h&gt;
</span><span class="cx"> #import &lt;WebCore/WebCoreNSStringExtras.h&gt;
</span><span class="lines">@@ -101,8 +100,6 @@
</span><span class="cx">         if (!flipped)
</span><span class="cx">             CGContextScaleCTM(cgContext, 1, -1);
</span><span class="cx"> 
</span><del>-        FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">         Font webCoreFont(FontPlatformData(font, [font pointSize]), ![nsContext isDrawingToScreen], fontSmoothingIsAllowed ? AutoSmoothing : Antialiased);
</span><span class="cx">         TextRun run(buffer.data(), length);
</span><span class="cx">         run.disableRoundingHacks();
</span><span class="lines">@@ -149,8 +146,6 @@
</span><span class="cx">     [self getCharacters:buffer.data()];
</span><span class="cx"> 
</span><span class="cx">     if (canUseFastRenderer(buffer.data(), length)) {
</span><del>-        FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">         Font webCoreFont(FontPlatformData(font, [font pointSize]), ![[NSGraphicsContext currentContext] isDrawingToScreen]);
</span><span class="cx">         TextRun run(buffer.data(), length);
</span><span class="cx">         run.disableRoundingHacks();
</span></span></pre></div>
<a id="trunkSourceWebKitmacMiscWebStringTruncatormm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Misc/WebStringTruncator.mm (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Misc/WebStringTruncator.mm        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebKit/mac/Misc/WebStringTruncator.mm        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> 
</span><span class="cx"> #import &quot;WebSystemInterface.h&quot;
</span><span class="cx"> #import &lt;WebCore/Font.h&gt;
</span><del>-#import &lt;WebCore/FontCache.h&gt;
</del><span class="cx"> #import &lt;WebCore/FontPlatformData.h&gt;
</span><span class="cx"> #import &lt;WebCore/StringTruncator.h&gt;
</span><span class="cx"> #import &lt;runtime/InitializeThreading.h&gt;
</span><span class="lines">@@ -60,25 +59,21 @@
</span><span class="cx"> + (NSString *)centerTruncateString:(NSString *)string toWidth:(float)maxWidth
</span><span class="cx"> {
</span><span class="cx">     static NeverDestroyed&lt;RetainPtr&lt;NSFont&gt;&gt; menuFont = [NSFont menuFontOfSize:0];
</span><del>-    WebCore::FontCachePurgePreventer fontCachePurgePreventer;
</del><span class="cx">     return WebCore::StringTruncator::centerTruncate(string, maxWidth, fontFromNSFont(menuFont.get().get()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> + (NSString *)centerTruncateString:(NSString *)string toWidth:(float)maxWidth withFont:(NSFont *)font
</span><span class="cx"> {
</span><del>-    WebCore::FontCachePurgePreventer fontCachePurgePreventer;
</del><span class="cx">     return WebCore::StringTruncator::centerTruncate(string, maxWidth, fontFromNSFont(font));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> + (NSString *)rightTruncateString:(NSString *)string toWidth:(float)maxWidth withFont:(NSFont *)font
</span><span class="cx"> {
</span><del>-    WebCore::FontCachePurgePreventer fontCachePurgePreventer;
</del><span class="cx">     return WebCore::StringTruncator::rightTruncate(string, maxWidth, fontFromNSFont(font));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> + (float)widthOfString:(NSString *)string font:(NSFont *)font
</span><span class="cx"> {
</span><del>-    WebCore::FontCachePurgePreventer fontCachePurgePreventer;
</del><span class="cx">     return WebCore::StringTruncator::width(string, fontFromNSFont(font));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebHTMLViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebHTMLView.mm (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebHTMLView.mm        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebKit/mac/WebView/WebHTMLView.mm        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -4878,7 +4878,6 @@
</span><span class="cx">     fontDescription.setItalic(italic);
</span><span class="cx">     fontDescription.setWeight(bold ? FontWeight900 : FontWeight500);
</span><span class="cx">     fontDescription.setSpecifiedSize(pointSize);
</span><del>-    FontCachePurgePreventer purgePreventer;
</del><span class="cx">     RefPtr&lt;SimpleFontData&gt; simpleFontData = fontCache().fontForFamily(fontDescription, familyName);
</span><span class="cx">     return [simpleFontData-&gt;platformData().nsFont() fontName];
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebKitGraphicscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebKitGraphics.cpp (178249 => 178250)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebKitGraphics.cpp        2015-01-11 22:55:43 UTC (rev 178249)
+++ trunk/Source/WebKit/win/WebKitGraphics.cpp        2015-01-11 22:58:09 UTC (rev 178250)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx"> #include &quot;WebPreferences.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &lt;WebCore/Font.h&gt;
</span><del>-#include &lt;WebCore/FontCache.h&gt;
</del><span class="cx"> #include &lt;WebCore/FontDescription.h&gt;
</span><span class="cx"> #include &lt;WebCore/FontSelector.h&gt;
</span><span class="cx"> #include &lt;WebCore/GraphicsContext.h&gt;
</span><span class="lines">@@ -114,8 +113,6 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(buffer);
</span><span class="cx"> 
</span><del>-    FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">     String result = StringTruncator::centerTruncate(String(text, length), width, makeFont(description), StringTruncator::EnableRoundingHacks);
</span><span class="cx">     StringView(result).getCharactersWithUpconvert(buffer);
</span><span class="cx">     buffer[result.length()] = '\0';
</span><span class="lines">@@ -126,8 +123,6 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(buffer);
</span><span class="cx"> 
</span><del>-    FontCachePurgePreventer fontCachePurgePreventer;
-
</del><span class="cx">     String result = StringTruncator::rightTruncate(String(text, length), width, makeFont(description), StringTruncator::EnableRoundingHacks);
</span><span class="cx">     StringView(result).getCharactersWithUpconvert(buffer);
</span><span class="cx">     buffer[result.length()] = '\0';
</span></span></pre>
</div>
</div>

</body>
</html>