Skip to content

Commit

Permalink
Get DisplayLink-related code out of WebProcessPool
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=252505
rdar://105613366

Reviewed by Tim Horton.

The list of DisplayLink objects is stored on WebProcessPool, since they are shared between all
WebPageProxy objects that use the same process pool. However, we don't need to pollute the
WebProcessPool API with DisplayLink-related functions; instead, just expose `DisplayLinkCollection`
and move the functionality into that class.

WebProcessProxy gains a couple more wrapper functions related to DisplayLinks.

Move to the more conventional `displayLinkForDisplay()` and `existingDisplayLinkForDisplay()`
terminology.

* Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::displayPropertiesChanged):
(WebKit::WebProcessPool::nominalFramesPerSecondForDisplay): Deleted.
(WebKit::WebProcessPool::startDisplayLink): Deleted.
(WebKit::WebProcessPool::stopDisplayLink): Deleted.
(WebKit::WebProcessPool::stopDisplayLinks): Deleted.
(WebKit::WebProcessPool::setDisplayLinkPreferredFramesPerSecond): Deleted.
(WebKit::WebProcessPool::setDisplayLinkForDisplayWantsFullSpeedUpdates): Deleted.
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeDrawingAreaProxyMac.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxyMac::exisingDisplayLink):
(WebKit::RemoteLayerTreeDrawingAreaProxyMac::ensureDisplayLink):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateDisplayLinkFrequency):
(WebKit::WebPageProxy::windowScreenDidChange):
* Source/WebKit/UIProcess/WebProcessPool.h:
* Source/WebKit/UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::~WebProcessProxy):
(WebKit::WebProcessProxy::processWillShutDown):
* Source/WebKit/UIProcess/WebProcessProxy.h:
* Source/WebKit/UIProcess/mac/DisplayLink.cpp:
(WebKit::DisplayLink::DisplayLink):
(WebKit::DisplayLink::nominalFramesPerSecondFromDisplayLink):
(WebKit::DisplayLink::addObserver):
(WebKit::DisplayLink::setObserverPreferredFramesPerSecond):
(WebKit::DisplayLink::notifyObserversDisplayWasRefreshed):
(WebKit::DisplayLinkCollection::displayLinkForDisplay):
(WebKit::DisplayLinkCollection::existingDisplayLinkForDisplay const):
(WebKit::DisplayLinkCollection::nominalFramesPerSecondForDisplay):
(WebKit::DisplayLinkCollection::startDisplayLink):
(WebKit::DisplayLinkCollection::stopDisplayLink):
(WebKit::DisplayLinkCollection::stopDisplayLinks):
(WebKit::DisplayLinkCollection::setDisplayLinkPreferredFramesPerSecond):
(WebKit::DisplayLinkCollection::setDisplayLinkForDisplayWantsFullSpeedUpdates):
(WebKit::DisplayLinkCollection::displayLinkForDisplay const): Deleted.
* Source/WebKit/UIProcess/mac/DisplayLink.h:
(WebKit::DisplayLinkCollection::displayLinks const): Deleted.
* Source/WebKit/UIProcess/mac/WebProcessProxyMac.mm:
(WebKit::WebProcessProxy::nominalFramesPerSecondForDisplay):
(WebKit::WebProcessProxy::startDisplayLink):
(WebKit::WebProcessProxy::stopDisplayLink):
(WebKit::WebProcessProxy::setDisplayLinkPreferredFramesPerSecond):
(WebKit::WebProcessProxy::setDisplayLinkForDisplayWantsFullSpeedUpdates):
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::windowDidChangeScreen):

Canonical link: https://commits.webkit.org/260489@main
  • Loading branch information
smfr committed Feb 18, 2023
1 parent 954abe6 commit 9bda52b
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 97 deletions.
60 changes: 1 addition & 59 deletions Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
Original file line number Diff line number Diff line change
Expand Up @@ -907,64 +907,6 @@ static bool determineIfWeShouldCrashWhenCreatingWebProcess()
return _CFNetworkIsKnownHSTSHostWithSession(url.get(), nullptr);
}

#if HAVE(CVDISPLAYLINK)

std::optional<unsigned> WebProcessPool::nominalFramesPerSecondForDisplay(WebCore::PlatformDisplayID displayID)
{
if (auto* displayLink = m_displayLinks.displayLinkForDisplay(displayID))
return displayLink->nominalFramesPerSecond();

// Note that this creates a DisplayLink with no observers, but it's highly likely that we'll soon call startDisplayLink() for it.
auto displayLink = makeUnique<DisplayLink>(displayID);
auto frameRate = displayLink->nominalFramesPerSecond();
m_displayLinks.add(WTFMove(displayLink));
return frameRate;
}

void WebProcessPool::startDisplayLink(WebProcessProxy& processProxy, DisplayLinkObserverID observerID, PlatformDisplayID displayID, WebCore::FramesPerSecond preferredFramesPerSecond)
{
if (auto* displayLink = m_displayLinks.displayLinkForDisplay(displayID)) {
displayLink->addObserver(processProxy.displayLinkClient(), observerID, preferredFramesPerSecond);
return;
}

auto displayLink = makeUnique<DisplayLink>(displayID);
displayLink->addObserver(processProxy.displayLinkClient(), observerID, preferredFramesPerSecond);
m_displayLinks.add(WTFMove(displayLink));
}

void WebProcessPool::stopDisplayLink(WebProcessProxy& processProxy, DisplayLinkObserverID observerID, PlatformDisplayID displayID)
{
if (auto* displayLink = m_displayLinks.displayLinkForDisplay(displayID))
displayLink->removeObserver(processProxy.displayLinkClient(), observerID);
}

void WebProcessPool::stopDisplayLinks(WebProcessProxy& processProxy)
{
for (auto& displayLink : m_displayLinks.displayLinks())
displayLink->removeClient(processProxy.displayLinkClient());
}

void WebProcessPool::setDisplayLinkPreferredFramesPerSecond(WebProcessProxy& processProxy, DisplayLinkObserverID observerID, PlatformDisplayID displayID, WebCore::FramesPerSecond preferredFramesPerSecond)
{
LOG_WITH_STREAM(DisplayLink, stream << "[UI ] WebProcessPool::setDisplayLinkPreferredFramesPerSecond - display " << displayID << " observer " << observerID << " fps " << preferredFramesPerSecond);

if (auto* displayLink = m_displayLinks.displayLinkForDisplay(displayID))
displayLink->setObserverPreferredFramesPerSecond(processProxy.displayLinkClient(), observerID, preferredFramesPerSecond);
}

void WebProcessPool::setDisplayLinkForDisplayWantsFullSpeedUpdates(WebProcessProxy& processProxy, WebCore::PlatformDisplayID displayID, bool wantsFullSpeedUpdates)
{
if (auto* displayLink = m_displayLinks.displayLinkForDisplay(displayID)) {
if (wantsFullSpeedUpdates)
displayLink->incrementFullSpeedRequestClientCount(processProxy.displayLinkClient());
else
displayLink->decrementFullSpeedRequestClientCount(processProxy.displayLinkClient());
}
}

#endif // HAVE(CVDISPLAYLINK)

// FIXME: Deprecated. Left here until a final decision is made.
void WebProcessPool::setCookieStoragePartitioningEnabled(bool enabled)
{
Expand Down Expand Up @@ -1200,7 +1142,7 @@ void setLockdownModeEnabledGloballyForTesting(std::optional<bool> enabledForTest
sendToAllProcesses(Messages::WebProcess::SetScreenProperties(screenProperties));
sendToAllProcesses(Messages::WebProcess::DisplayConfigurationChanged(displayID, flags));

if (auto* displayLink = displayLinks().displayLinkForDisplay(displayID))
if (auto* displayLink = displayLinks().existingDisplayLinkForDisplay(displayID))
displayLink->displayPropertiesChanged();

#if ENABLE(GPU_PROCESS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,21 +104,15 @@ explicit RemoteLayerTreeDisplayLinkClient(WebPageProxyIdentifier pageID)
if (!m_displayID)
return nullptr;

return m_webPageProxy.process().processPool().displayLinks().displayLinkForDisplay(*m_displayID);
return m_webPageProxy.process().processPool().displayLinks().existingDisplayLinkForDisplay(*m_displayID);
}

DisplayLink& RemoteLayerTreeDrawingAreaProxyMac::ensureDisplayLink()
{
ASSERT(m_displayID);

auto& displayLinks = m_webPageProxy.process().processPool().displayLinks();
auto* displayLink = displayLinks.displayLinkForDisplay(*m_displayID);
if (!displayLink) {
auto newDisplayLink = makeUnique<DisplayLink>(*m_displayID);
displayLink = newDisplayLink.get();
displayLinks.add(WTFMove(newDisplayLink));
}
return *displayLink;
return displayLinks.displayLinkForDisplay(*m_displayID);
}

void RemoteLayerTreeDrawingAreaProxyMac::removeObserver(std::optional<DisplayLinkObserverID>& observerID)
Expand Down
4 changes: 2 additions & 2 deletions Source/WebKit/UIProcess/WebPageProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3091,7 +3091,7 @@ void WebPageProxy::updateDisplayLinkFrequency()

bool wantsFullSpeedUpdates = m_hasActiveAnimatedScroll || m_wheelEventActivityHysteresis.state() == PAL::HysteresisState::Started;
if (wantsFullSpeedUpdates != m_registeredForFullSpeedUpdates) {
process().processPool().setDisplayLinkForDisplayWantsFullSpeedUpdates(process(), *m_displayID, wantsFullSpeedUpdates);
process().setDisplayLinkForDisplayWantsFullSpeedUpdates(*m_displayID, wantsFullSpeedUpdates);
m_registeredForFullSpeedUpdates = wantsFullSpeedUpdates;
}
}
Expand Down Expand Up @@ -4142,7 +4142,7 @@ void WebPageProxy::windowScreenDidChange(PlatformDisplayID displayID, std::optio
{
#if HAVE(CVDISPLAYLINK)
if (hasRunningProcess() && m_displayID && m_registeredForFullSpeedUpdates)
process().processPool().setDisplayLinkForDisplayWantsFullSpeedUpdates(process(), *m_displayID, false);
process().setDisplayLinkForDisplayWantsFullSpeedUpdates(*m_displayID, false);

m_registeredForFullSpeedUpdates = false;
#endif
Expand Down
8 changes: 0 additions & 8 deletions Source/WebKit/UIProcess/WebProcessPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,6 @@ class WebProcessPool final

#if HAVE(CVDISPLAYLINK)
DisplayLinkCollection& displayLinks() { return m_displayLinks; }

std::optional<WebCore::FramesPerSecond> nominalFramesPerSecondForDisplay(WebCore::PlatformDisplayID);

void startDisplayLink(WebProcessProxy&, DisplayLinkObserverID, WebCore::PlatformDisplayID, WebCore::FramesPerSecond);
void stopDisplayLink(WebProcessProxy&, DisplayLinkObserverID, WebCore::PlatformDisplayID);
void setDisplayLinkPreferredFramesPerSecond(WebProcessProxy&, DisplayLinkObserverID, WebCore::PlatformDisplayID, WebCore::FramesPerSecond);
void stopDisplayLinks(WebProcessProxy&);
void setDisplayLinkForDisplayWantsFullSpeedUpdates(WebProcessProxy&, WebCore::PlatformDisplayID, bool wantsFullSpeedUpdates);
#endif

void addSupportedPlugin(String&& matchingDomain, String&& name, HashSet<String>&& mimeTypes, HashSet<String> extensions);
Expand Down
4 changes: 2 additions & 2 deletions Source/WebKit/UIProcess/WebProcessProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ WebProcessProxy::~WebProcessProxy()
WebPasteboardProxy::singleton().removeWebProcessProxy(*this);

#if HAVE(CVDISPLAYLINK)
processPool().stopDisplayLinks(*this);
processPool().displayLinks().stopDisplayLinks(m_displayLinkClient);
#endif

auto isResponsiveCallbacks = WTFMove(m_isResponsiveCallbacks);
Expand Down Expand Up @@ -576,7 +576,7 @@ void WebProcessProxy::processWillShutDown(IPC::Connection& connection)

#if HAVE(CVDISPLAYLINK)
m_displayLinkClient.setConnection(nullptr);
processPool().stopDisplayLinks(*this);
processPool().displayLinks().stopDisplayLinks(m_displayLinkClient);
#endif
}

Expand Down
2 changes: 2 additions & 0 deletions Source/WebKit/UIProcess/WebProcessProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,12 @@ class WebProcessProxy : public AuxiliaryProcessProxy, private ProcessThrottlerCl

#if HAVE(CVDISPLAYLINK)
DisplayLink::Client& displayLinkClient() { return m_displayLinkClient; }
std::optional<unsigned> nominalFramesPerSecondForDisplay(WebCore::PlatformDisplayID);

void startDisplayLink(DisplayLinkObserverID, WebCore::PlatformDisplayID, WebCore::FramesPerSecond);
void stopDisplayLink(DisplayLinkObserverID, WebCore::PlatformDisplayID);
void setDisplayLinkPreferredFramesPerSecond(DisplayLinkObserverID, WebCore::PlatformDisplayID, WebCore::FramesPerSecond);
void setDisplayLinkForDisplayWantsFullSpeedUpdates(WebCore::PlatformDisplayID, bool wantsFullSpeedUpdates);
#endif

// Called when the web process has crashed or we know that it will terminate soon.
Expand Down
80 changes: 70 additions & 10 deletions Source/WebKit/UIProcess/mac/DisplayLink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@

namespace WebKit {

using namespace WebCore;

constexpr unsigned maxFireCountWithoutObservers { 20 };

DisplayLink::DisplayLink(WebCore::PlatformDisplayID displayID)
DisplayLink::DisplayLink(PlatformDisplayID displayID)
: m_displayID(displayID)
{
// FIXME: We can get here with displayID == 0 (webkit.org/b/212120), in which case CVDisplayLinkCreateWithCGDisplay()
Expand Down Expand Up @@ -74,17 +76,17 @@ DisplayLink::~DisplayLink()
CVDisplayLinkRelease(m_displayLink);
}

WebCore::FramesPerSecond DisplayLink::nominalFramesPerSecondFromDisplayLink(CVDisplayLinkRef displayLink)
FramesPerSecond DisplayLink::nominalFramesPerSecondFromDisplayLink(CVDisplayLinkRef displayLink)
{
CVTime refreshPeriod = CVDisplayLinkGetNominalOutputVideoRefreshPeriod(displayLink);
if (!refreshPeriod.timeValue)
return WebCore::FullSpeedFramesPerSecond;
return FullSpeedFramesPerSecond;

WebCore::FramesPerSecond result = round((double)refreshPeriod.timeScale / (double)refreshPeriod.timeValue);
return result ?: WebCore::FullSpeedFramesPerSecond;
FramesPerSecond result = round((double)refreshPeriod.timeScale / (double)refreshPeriod.timeValue);
return result ?: FullSpeedFramesPerSecond;
}

void DisplayLink::addObserver(Client& client, DisplayLinkObserverID observerID, WebCore::FramesPerSecond preferredFramesPerSecond)
void DisplayLink::addObserver(Client& client, DisplayLinkObserverID observerID, FramesPerSecond preferredFramesPerSecond)
{
ASSERT(RunLoop::isMain());

Expand Down Expand Up @@ -190,7 +192,7 @@ void DisplayLink::displayPropertiesChanged()
// FIXME: Detect whether the refresh frequency changed.
}

void DisplayLink::setObserverPreferredFramesPerSecond(Client& client, DisplayLinkObserverID observerID, WebCore::FramesPerSecond preferredFramesPerSecond)
void DisplayLink::setObserverPreferredFramesPerSecond(Client& client, DisplayLinkObserverID observerID, FramesPerSecond preferredFramesPerSecond)
{
LOG_WITH_STREAM(DisplayLink, stream << "[UI ] DisplayLink " << this << " setPreferredFramesPerSecond - display " << m_displayID << " observer " << observerID << " fps " << preferredFramesPerSecond);

Expand Down Expand Up @@ -222,7 +224,7 @@ void DisplayLink::notifyObserversDisplayWasRefreshed()
Locker locker { m_clientsLock };

auto maxFramesPerSecond = [](const Vector<ObserverInfo>& observers) {
std::optional<WebCore::FramesPerSecond> observersMaxFramesPerSecond;
std::optional<FramesPerSecond> observersMaxFramesPerSecond;
for (const auto& observer : observers)
observersMaxFramesPerSecond = std::max(observersMaxFramesPerSecond.value_or(0), observer.preferredFramesPerSecond);
return observersMaxFramesPerSecond;
Expand All @@ -236,7 +238,7 @@ void DisplayLink::notifyObserversDisplayWasRefreshed()
anyConnectionHadObservers = true;

auto observersMaxFramesPerSecond = maxFramesPerSecond(clientInfo.observers);
bool anyObserverWantsCallback = m_currentUpdate.relevantForUpdateFrequency(observersMaxFramesPerSecond.value_or(WebCore::FullSpeedFramesPerSecond));
bool anyObserverWantsCallback = m_currentUpdate.relevantForUpdateFrequency(observersMaxFramesPerSecond.value_or(FullSpeedFramesPerSecond));

LOG_WITH_STREAM(DisplayLink, stream << "[UI ] DisplayLink " << this << " for display " << m_displayID << " (display fps " << m_displayNominalFramesPerSecond << ") update " << m_currentUpdate << " " << clientInfo.observers.size()
<< " observers, maxFramesPerSecond " << observersMaxFramesPerSecond << " full speed client count " << clientInfo.fullSpeedUpdatesClientCount << " relevant " << anyObserverWantsCallback);
Expand All @@ -257,7 +259,18 @@ void DisplayLink::notifyObserversDisplayWasRefreshed()
m_fireCountWithoutObservers = 0;
}

DisplayLink* DisplayLinkCollection::displayLinkForDisplay(WebCore::PlatformDisplayID displayID) const
DisplayLink& DisplayLinkCollection::displayLinkForDisplay(PlatformDisplayID displayID)
{
if (auto* displayLink = existingDisplayLinkForDisplay(displayID))
return *displayLink;

auto displayLink = makeUnique<DisplayLink>(displayID);
auto displayLinkPtr = displayLink.get();
add(WTFMove(displayLink));
return *displayLinkPtr;
}

DisplayLink* DisplayLinkCollection::existingDisplayLinkForDisplay(PlatformDisplayID displayID) const
{
for (auto& displayLink : m_displayLinks) {
if (displayLink->displayID() == displayID)
Expand All @@ -273,6 +286,53 @@ void DisplayLinkCollection::add(std::unique_ptr<DisplayLink>&& displayLink)
m_displayLinks.append(WTFMove(displayLink));
}

std::optional<unsigned> DisplayLinkCollection::nominalFramesPerSecondForDisplay(PlatformDisplayID displayID)
{
// Note that this may create a DisplayLink with no observers, but it's highly likely that we'll soon call startDisplayLink() for it.
auto& displayLink = displayLinkForDisplay(displayID);
return displayLink.nominalFramesPerSecond();
}

void DisplayLinkCollection::startDisplayLink(DisplayLink::Client& client, DisplayLinkObserverID observerID, PlatformDisplayID displayID, FramesPerSecond preferredFramesPerSecond)
{
auto& displayLink = displayLinkForDisplay(displayID);
displayLink.addObserver(client, observerID, preferredFramesPerSecond);
}

void DisplayLinkCollection::stopDisplayLink(DisplayLink::Client& client, DisplayLinkObserverID observerID, PlatformDisplayID displayID)
{
if (auto* displayLink = existingDisplayLinkForDisplay(displayID))
displayLink->removeObserver(client, observerID);

// FIXME: Remove unused display links?
}

void DisplayLinkCollection::stopDisplayLinks(DisplayLink::Client& client)
{
for (auto& displayLink : m_displayLinks)
displayLink->removeClient(client);

// FIXME: Remove unused display links?
}

void DisplayLinkCollection::setDisplayLinkPreferredFramesPerSecond(DisplayLink::Client& client, DisplayLinkObserverID observerID, PlatformDisplayID displayID, FramesPerSecond preferredFramesPerSecond)
{
LOG_WITH_STREAM(DisplayLink, stream << "[UI ] WebProcessPool::setDisplayLinkPreferredFramesPerSecond - display " << displayID << " observer " << observerID << " fps " << preferredFramesPerSecond);

if (auto* displayLink = existingDisplayLinkForDisplay(displayID))
displayLink->setObserverPreferredFramesPerSecond(client, observerID, preferredFramesPerSecond);
}

void DisplayLinkCollection::setDisplayLinkForDisplayWantsFullSpeedUpdates(DisplayLink::Client& client, PlatformDisplayID displayID, bool wantsFullSpeedUpdates)
{
if (auto* displayLink = existingDisplayLinkForDisplay(displayID)) {
if (wantsFullSpeedUpdates)
displayLink->incrementFullSpeedRequestClientCount(client);
else
displayLink->decrementFullSpeedRequestClientCount(client);
}
}

} // namespace WebKit

#endif // HAVE(CVDISPLAYLINK)
14 changes: 10 additions & 4 deletions Source/WebKit/UIProcess/mac/DisplayLink.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,19 @@ class DisplayLink {

class DisplayLinkCollection {
public:
void add(std::unique_ptr<DisplayLink>&&);

DisplayLink* displayLinkForDisplay(WebCore::PlatformDisplayID) const;
DisplayLink& displayLinkForDisplay(WebCore::PlatformDisplayID);
DisplayLink* existingDisplayLinkForDisplay(WebCore::PlatformDisplayID) const;

const Vector<std::unique_ptr<DisplayLink>>& displayLinks() const { return m_displayLinks; }
std::optional<unsigned> nominalFramesPerSecondForDisplay(WebCore::PlatformDisplayID);
void startDisplayLink(DisplayLink::Client&, DisplayLinkObserverID, WebCore::PlatformDisplayID, WebCore::FramesPerSecond preferredFramesPerSecond);
void stopDisplayLink(DisplayLink::Client&, DisplayLinkObserverID, WebCore::PlatformDisplayID);
void stopDisplayLinks(DisplayLink::Client&);
void setDisplayLinkPreferredFramesPerSecond(DisplayLink::Client&, DisplayLinkObserverID, WebCore::PlatformDisplayID, WebCore::FramesPerSecond preferredFramesPerSecond);
void setDisplayLinkForDisplayWantsFullSpeedUpdates(DisplayLink::Client&, WebCore::PlatformDisplayID, bool wantsFullSpeedUpdates);

private:
void add(std::unique_ptr<DisplayLink>&&);

Vector<std::unique_ptr<DisplayLink>> m_displayLinks;
};

Expand Down
16 changes: 13 additions & 3 deletions Source/WebKit/UIProcess/mac/WebProcessProxyMac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,30 @@
return !path.isEmpty() && !path.startsWith("/System/"_s);
}

std::optional<unsigned> WebProcessProxy::nominalFramesPerSecondForDisplay(WebCore::PlatformDisplayID displayID)
{
return processPool().displayLinks().nominalFramesPerSecondForDisplay(displayID);
}

void WebProcessProxy::startDisplayLink(DisplayLinkObserverID observerID, WebCore::PlatformDisplayID displayID, WebCore::FramesPerSecond preferredFramesPerSecond)
{
ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
processPool().startDisplayLink(*this, observerID, displayID, preferredFramesPerSecond);
processPool().displayLinks().startDisplayLink(m_displayLinkClient, observerID, displayID, preferredFramesPerSecond);
}

void WebProcessProxy::stopDisplayLink(DisplayLinkObserverID observerID, WebCore::PlatformDisplayID displayID)
{
processPool().stopDisplayLink(*this, observerID, displayID);
processPool().displayLinks().stopDisplayLink(m_displayLinkClient, observerID, displayID);
}

void WebProcessProxy::setDisplayLinkPreferredFramesPerSecond(DisplayLinkObserverID observerID, WebCore::PlatformDisplayID displayID, WebCore::FramesPerSecond preferredFramesPerSecond)
{
processPool().setDisplayLinkPreferredFramesPerSecond(*this, observerID, displayID, preferredFramesPerSecond);
processPool().displayLinks().setDisplayLinkPreferredFramesPerSecond(m_displayLinkClient, observerID, displayID, preferredFramesPerSecond);
}

void WebProcessProxy::setDisplayLinkForDisplayWantsFullSpeedUpdates(WebCore::PlatformDisplayID displayID, bool wantsFullSpeedUpdates)
{
processPool().displayLinks().setDisplayLinkForDisplayWantsFullSpeedUpdates(m_displayLinkClient, displayID, wantsFullSpeedUpdates);
}

void WebProcessProxy::platformSuspendProcess()
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/UIProcess/mac/WebViewImpl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2024,7 +2024,7 @@ static NSTrackingAreaOptions trackingAreaOptions()
{
NSWindow *window = m_targetWindowForMovePreparation ? m_targetWindowForMovePreparation.get() : [m_view window];
auto displayID = WebCore::displayID(window.screen);
auto framesPerSecond = m_page->process().processPool().nominalFramesPerSecondForDisplay(displayID);
auto framesPerSecond = m_page->process().nominalFramesPerSecondForDisplay(displayID);
m_page->windowScreenDidChange(displayID, framesPerSecond);
}

Expand Down

0 comments on commit 9bda52b

Please sign in to comment.