Changeset 150013 in webkit
- Timestamp:
- May 13, 2013 8:05:18 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r150011 r150013 1 2013-05-13 Andreas Kling <akling@apple.com> 2 3 Document: Use a DeferrableOneShotTimer to throw out StyleResolver when unused. 4 <http://webkit.org/b/115929> 5 6 Reviewed by Anders Carlsson. 7 8 Nothing exciting here, just replacing a rickety-looking punting mechanism with a proper 9 DeferrableOneShotTimer. Note that the timeout changes from 60 to 30 seconds because DOST 10 works by punting a full interval on next timeout. 11 12 * dom/Document.cpp: 13 (WebCore::Document::Document): 14 (WebCore::Document::didAccessStyleResolver): 15 (WebCore::Document::styleResolverThrowawayTimerFired): 16 * dom/Document.h: 17 (Document): 18 1 19 2013-05-13 Andreas Kling <akling@apple.com> 2 20 -
trunk/Source/WebCore/dom/Document.cpp
r149957 r150013 414 414 uint64_t Document::s_globalTreeVersion = 0; 415 415 416 static const double timeBeforeThrowingAwayStyleResolverAfterLastUseInSeconds = 30; 417 416 418 Document::Document(Frame* frame, const KURL& url, unsigned documentClasses) 417 419 : ContainerNode(0, CreateDocument) 418 420 , TreeScope(this) 419 , m_styleResolverThrowawayTimer(this, &Document::styleResolverThrowawayTimerFired) 420 , m_lastStyleResolverAccessTime(0) 421 , m_styleResolverThrowawayTimer(this, &Document::styleResolverThrowawayTimerFired, timeBeforeThrowingAwayStyleResolverAfterLastUseInSeconds) 421 422 , m_activeParserCount(0) 422 423 , m_contextFeatures(ContextFeatures::defaultSwitch()) … … 4466 4467 void Document::didAccessStyleResolver() 4467 4468 { 4468 static const int timeBeforeThrowingAwayStyleResolverAfterLastUseInSeconds = 60; 4469 static const int holdOffTimeBeforeReschedulingTimerInSeconds = 5; 4470 4471 double currentTime = WTF::currentTime(); 4472 4473 if (currentTime > m_lastStyleResolverAccessTime + holdOffTimeBeforeReschedulingTimerInSeconds) { 4474 m_styleResolverThrowawayTimer.startOneShot(timeBeforeThrowingAwayStyleResolverAfterLastUseInSeconds); 4475 m_lastStyleResolverAccessTime = currentTime; 4476 } 4477 } 4478 4479 void Document::styleResolverThrowawayTimerFired(Timer<Document>*) 4469 m_styleResolverThrowawayTimer.restart(); 4470 } 4471 4472 void Document::styleResolverThrowawayTimerFired(DeferrableOneShotTimer<Document>*) 4480 4473 { 4481 4474 ASSERT(!m_inStyleRecalc); -
trunk/Source/WebCore/dom/Document.h
r149959 r150013 1296 1296 void didAssociateFormControlsTimerFired(Timer<Document>*); 1297 1297 1298 void styleResolverThrowawayTimerFired(Timer<Document>*); 1299 Timer<Document> m_styleResolverThrowawayTimer; 1300 double m_lastStyleResolverAccessTime; 1298 void styleResolverThrowawayTimerFired(DeferrableOneShotTimer<Document>*); 1299 DeferrableOneShotTimer<Document> m_styleResolverThrowawayTimer; 1301 1300 1302 1301 OwnPtr<StyleResolver> m_styleResolver;
Note: See TracChangeset
for help on using the changeset viewer.