Title: [141280] trunk/Source/WebCore
Revision
141280
Author
[email protected]
Date
2013-01-30 09:55:48 -0800 (Wed, 30 Jan 2013)

Log Message

Do not restart the matched properties cache timer if active
https://bugs.webkit.org/show_bug.cgi?id=108345

Reviewed by Andreas Kling.

StyleResolver::addToMatchedPropertiesCache() keeps resetting the timer as more than
matchedDeclarationCacheAdditionsBetweenSweeps entries are added. When armed, we should let
the timer expire at its scheduled time - otherwise it may never get a chance to fire if
entries keep getting added.

No new tests. This is a long lived timer (1min) which makes testing impractical.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::addToMatchedPropertiesCache):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (141279 => 141280)


--- trunk/Source/WebCore/ChangeLog	2013-01-30 17:55:34 UTC (rev 141279)
+++ trunk/Source/WebCore/ChangeLog	2013-01-30 17:55:48 UTC (rev 141280)
@@ -1,3 +1,20 @@
+2013-01-30  Florin Malita  <[email protected]>
+
+        Do not restart the matched properties cache timer if active
+        https://bugs.webkit.org/show_bug.cgi?id=108345
+
+        Reviewed by Andreas Kling.
+
+        StyleResolver::addToMatchedPropertiesCache() keeps resetting the timer as more than
+        matchedDeclarationCacheAdditionsBetweenSweeps entries are added. When armed, we should let
+        the timer expire at its scheduled time - otherwise it may never get a chance to fire if
+        entries keep getting added.
+
+        No new tests. This is a long lived timer (1min) which makes testing impractical.
+
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::addToMatchedPropertiesCache):
+
 2013-01-30  Simon Fraser  <[email protected]>
 
         Temporarily disable assertions related to clip rect computation in RenderLayer

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (141279 => 141280)


--- trunk/Source/WebCore/css/StyleResolver.cpp	2013-01-30 17:55:34 UTC (rev 141279)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2013-01-30 17:55:48 UTC (rev 141280)
@@ -2472,7 +2472,8 @@
 void StyleResolver::addToMatchedPropertiesCache(const RenderStyle* style, const RenderStyle* parentStyle, unsigned hash, const MatchResult& matchResult)
 {
     static const unsigned matchedDeclarationCacheAdditionsBetweenSweeps = 100;
-    if (++m_matchedPropertiesCacheAdditionsSinceLastSweep >= matchedDeclarationCacheAdditionsBetweenSweeps) {
+    if (++m_matchedPropertiesCacheAdditionsSinceLastSweep >= matchedDeclarationCacheAdditionsBetweenSweeps
+        && !m_matchedPropertiesCacheSweepTimer.isActive()) {
         static const unsigned matchedDeclarationCacheSweepTimeInSeconds = 60;
         m_matchedPropertiesCacheSweepTimer.startOneShot(matchedDeclarationCacheSweepTimeInSeconds);
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to