Changeset 226664 in webkit
- Timestamp:
- Jan 9, 2018 3:47:37 PM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r226660 r226664 1 2018-01-09 Jer Noble <jer.noble@apple.com> 2 3 Many CVDisplayLink threads created and destroyed while watching a YouTube video 4 https://bugs.webkit.org/show_bug.cgi?id=181396 5 6 Reviewed by Simon Fraser. 7 8 When watching some YouTube videos (or any video with default controls), event handlers for 9 the "timeupdate" event which use rAF will cause the underlying platform objects to be 10 destroyed in between "timeupdate" events being fired, since they occur every 250ms, and rAF 11 objects are destroyed every 166ms (or 10/60hz). Update this constant to destroy the 12 underlying objects every 333ms (or 20/60hz) so that this common pattern doesn't lead to 13 excessive rAF platform object turnover. 14 15 * platform/Logging.h: 16 * platform/graphics/DisplayRefreshMonitor.h: 17 (WebCore::DisplayRefreshMonitor::shouldBeTerminated const): 18 * platform/graphics/DisplayRefreshMonitor.cpp: 19 (WebCore::DisplayRefreshMonitor::displayDidRefresh): 20 * platform/graphics/DisplayRefreshMonitorManager.cpp: 21 (WebCore::DisplayRefreshMonitorManager::createMonitorForClient): 22 (WebCore::DisplayRefreshMonitorManager::displayDidRefresh): 23 1 24 2018-01-09 Zalan Bujtas <zalan@apple.com> 2 25 -
trunk/Source/WebCore/platform/Logging.h
r225449 r226664 79 79 M(Progress) \ 80 80 M(RemoteInspector) \ 81 M(RequestAnimationFrame) \ 81 82 M(ResourceLoading) \ 82 83 M(ResourceLoadObserver) \ -
trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp
r225509 r226664 86 86 { 87 87 LockHolder lock(m_mutex); 88 LOG(RequestAnimationFrame, "DisplayRefreshMonitor::displayDidRefresh(%p) - m_scheduled(%d), m_unscheduledFireCount(%d)", this, m_scheduled, m_unscheduledFireCount); 88 89 if (!m_scheduled) 89 90 ++m_unscheduledFireCount; -
trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h
r224797 r226664 57 57 bool shouldBeTerminated() const 58 58 { 59 const int maxInactiveFireCount = 10;59 const int maxInactiveFireCount = 20; 60 60 return !m_scheduled && m_unscheduledFireCount > maxInactiveFireCount; 61 61 } -
trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.cpp
r223728 r226664 31 31 #include "DisplayRefreshMonitor.h" 32 32 #include "DisplayRefreshMonitorClient.h" 33 #include "Logging.h" 33 34 #include <wtf/CurrentTime.h> 34 35 … … 57 58 return nullptr; 58 59 60 LOG(RequestAnimationFrame, "DisplayRefreshMonitorManager::createMonitorForClient() - created monitor %p", monitor.get()); 59 61 monitor->addClient(client); 60 62 DisplayRefreshMonitor* result = monitor.get(); … … 106 108 if (!monitor.shouldBeTerminated()) 107 109 return; 110 LOG(RequestAnimationFrame, "DisplayRefreshMonitorManager::displayDidRefresh() - destroying monitor %p", &monitor); 108 111 109 112 size_t monitorIndex = m_monitors.find(&monitor);
Note: See TracChangeset
for help on using the changeset viewer.