Title: [232563] trunk/Source/WebCore
Revision
232563
Author
[email protected]
Date
2018-06-06 17:37:47 -0700 (Wed, 06 Jun 2018)

Log Message

Display links are sometimes not notifying WebCore when fired.
https://bugs.webkit.org/show_bug.cgi?id=186367
<rdar://problem/40439109>

Reviewed by Brent Fulgham.

When the WebContent process is receiving an IPC message notifying about a screen update, all display refresh monitors
are notified by the manager in DisplayRefreshMonitorManager::displayWasUpdated(). The manager checks that the monitor
is scheduled before notifying. This is a problem, since the scheduled flag is always set to false in the
DisplayRefreshMonitor::displayDidRefresh() method, when the monitor is first notified about a screen update. This can
lead to display links running without notifying the monitors, causing extra CPU usage. It can also prevent them from
being deleted, since the monitors are not notified. Instead, we can check that the display refresh monitor is active
before notifying it. This matches the original display link implementation used when the WebContent process has
WindowServer access, where the monitors are always notified.

No new tests, since I have not been able to reproduce this in a test case yet.

* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::displayWasUpdated):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (232562 => 232563)


--- trunk/Source/WebCore/ChangeLog	2018-06-07 00:01:31 UTC (rev 232562)
+++ trunk/Source/WebCore/ChangeLog	2018-06-07 00:37:47 UTC (rev 232563)
@@ -1,3 +1,25 @@
+2018-06-06  Per Arne Vollan  <[email protected]>
+
+        Display links are sometimes not notifying WebCore when fired.
+        https://bugs.webkit.org/show_bug.cgi?id=186367
+        <rdar://problem/40439109>
+
+        Reviewed by Brent Fulgham.
+
+        When the WebContent process is receiving an IPC message notifying about a screen update, all display refresh monitors
+        are notified by the manager in DisplayRefreshMonitorManager::displayWasUpdated(). The manager checks that the monitor
+        is scheduled before notifying. This is a problem, since the scheduled flag is always set to false in the
+        DisplayRefreshMonitor::displayDidRefresh() method, when the monitor is first notified about a screen update. This can
+        lead to display links running without notifying the monitors, causing extra CPU usage. It can also prevent them from
+        being deleted, since the monitors are not notified. Instead, we can check that the display refresh monitor is active
+        before notifying it. This matches the original display link implementation used when the WebContent process has
+        WindowServer access, where the monitors are always notified.
+
+        No new tests, since I have not been able to reproduce this in a test case yet.
+
+        * platform/graphics/DisplayRefreshMonitorManager.cpp:
+        (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
+
 2018-06-06  Antoine Quint  <[email protected]>
 
         Rename color-filter to -apple-color-filter and do not expose it to Web content

Modified: trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.cpp (232562 => 232563)


--- trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.cpp	2018-06-07 00:01:31 UTC (rev 232562)
+++ trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.cpp	2018-06-07 00:37:47 UTC (rev 232563)
@@ -128,7 +128,7 @@
 void DisplayRefreshMonitorManager::displayWasUpdated()
 {
     for (auto monitor : m_monitors) {
-        if (monitor->isScheduled())
+        if (monitor->isActive())
             monitor->displayLinkFired();
     }
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to