Title: [232652] trunk/Source
Revision
232652
Author
pvol...@apple.com
Date
2018-06-08 16:50:13 -0700 (Fri, 08 Jun 2018)

Log Message

Only display refresh monitors having requested display refresh callback should get notified on screen updates.
https://bugs.webkit.org/show_bug.cgi?id=186397
<rdar://problem/40897835>

Reviewed by Brent Fulgham.

Since all display refresh monitors in the WebContent process share a single UI process display link,
we should make sure that only the monitors having requested callback are getting notified on screen
updates. I have not been able to reproduce a case where a monitor is being notified without having
requested updates, but we should safeguard the code for future code changes.

Source/WebCore:

No new tests, since this is a safeguarding measure.

* platform/graphics/DisplayRefreshMonitor.h:
(WebCore::DisplayRefreshMonitor::hasRequestedRefreshCallback const):
* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::displayWasUpdated):

Source/WebKit:

* WebProcess/WebPage/mac/DrawingAreaMac.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (232651 => 232652)


--- trunk/Source/WebCore/ChangeLog	2018-06-08 23:48:23 UTC (rev 232651)
+++ trunk/Source/WebCore/ChangeLog	2018-06-08 23:50:13 UTC (rev 232652)
@@ -1,3 +1,23 @@
+2018-06-08  Per Arne Vollan  <pvol...@apple.com>
+
+        Only display refresh monitors having requested display refresh callback should get notified on screen updates.
+        https://bugs.webkit.org/show_bug.cgi?id=186397
+        <rdar://problem/40897835>
+
+        Reviewed by Brent Fulgham.
+
+        Since all display refresh monitors in the WebContent process share a single UI process display link,
+        we should make sure that only the monitors having requested callback are getting notified on screen
+        updates. I have not been able to reproduce a case where a monitor is being notified without having
+        requested updates, but we should safeguard the code for future code changes.
+
+        No new tests, since this is a safeguarding measure.
+
+        * platform/graphics/DisplayRefreshMonitor.h:
+        (WebCore::DisplayRefreshMonitor::hasRequestedRefreshCallback const):
+        * platform/graphics/DisplayRefreshMonitorManager.cpp:
+        (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
+
 2018-06-07  Jer Noble  <jer.no...@apple.com>
 
         REGRESSION:  Cannot listen to audio on Google Translate with side switch set to "vibrate"

Modified: trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h (232651 => 232652)


--- trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h	2018-06-08 23:48:23 UTC (rev 232651)
+++ trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h	2018-06-08 23:50:13 UTC (rev 232652)
@@ -81,6 +81,8 @@
     bool isPreviousFrameDone() const { return m_previousFrameDone; }
     void setIsPreviousFrameDone(bool done) { m_previousFrameDone = done; }
 
+    virtual bool hasRequestedRefreshCallback() const { return false; }
+
 private:
     void displayDidRefresh();
 

Modified: trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.cpp (232651 => 232652)


--- trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.cpp	2018-06-08 23:48:23 UTC (rev 232651)
+++ trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.cpp	2018-06-08 23:50:13 UTC (rev 232652)
@@ -128,7 +128,7 @@
 void DisplayRefreshMonitorManager::displayWasUpdated()
 {
     for (auto monitor : m_monitors) {
-        if (monitor->isActive())
+        if (monitor->hasRequestedRefreshCallback())
             monitor->displayLinkFired();
     }
 }

Modified: trunk/Source/WebKit/ChangeLog (232651 => 232652)


--- trunk/Source/WebKit/ChangeLog	2018-06-08 23:48:23 UTC (rev 232651)
+++ trunk/Source/WebKit/ChangeLog	2018-06-08 23:50:13 UTC (rev 232652)
@@ -1,3 +1,18 @@
+2018-06-08  Per Arne Vollan  <pvol...@apple.com>
+
+        Only display refresh monitors having requested display refresh callback should get notified on screen updates.
+        https://bugs.webkit.org/show_bug.cgi?id=186397
+        <rdar://problem/40897835>
+
+        Reviewed by Brent Fulgham.
+
+        Since all display refresh monitors in the WebContent process share a single UI process display link,
+        we should make sure that only the monitors having requested callback are getting notified on screen
+        updates. I have not been able to reproduce a case where a monitor is being notified without having
+        requested updates, but we should safeguard the code for future code changes.
+
+        * WebProcess/WebPage/mac/DrawingAreaMac.cpp:
+
 2018-06-08  Aditya Keerthi  <akeer...@apple.com>
 
         [Datalist] Allow TextFieldInputType to show and hide suggestions

Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/DrawingAreaMac.cpp (232651 => 232652)


--- trunk/Source/WebKit/WebProcess/WebPage/mac/DrawingAreaMac.cpp	2018-06-08 23:48:23 UTC (rev 232651)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/DrawingAreaMac.cpp	2018-06-08 23:50:13 UTC (rev 232652)
@@ -55,6 +55,8 @@
 private:
     explicit DisplayRefreshMonitorMac(PlatformDisplayID, WebPage&);
     
+    bool hasRequestedRefreshCallback() const override { return m_hasSentMessage; }
+
     Ref<WebPage> m_webPage;
     bool m_hasSentMessage { false };
     unsigned m_observerID;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to