Skip to content

Commit

Permalink
Deploy more smart pointers in Source/WebKit/UIProcess/
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=260847

Reviewed by Chris Dumez.

Deployed more smart pointers.

* Source/WebKit/UIProcess/GPU/GPUProcessProxy.cpp:
(WebKit::GPUProcessProxy::updatePreferences):
* Source/WebKit/UIProcess/Gamepad/UIGamepadProvider.cpp:
(WebKit::UIGamepadProvider::gamepadSyncTimerFired):
(WebKit::UIGamepadProvider::viewBecameInactive):
* Source/WebKit/UIProcess/HighPerformanceGraphicsUsageSampler.cpp:
(WebKit::HighPerformanceGraphicsUsageSampler::timerFired):
* Source/WebKit/UIProcess/HighPerformanceGraphicsUsageSampler.h:

Canonical link: https://commits.webkit.org/267426@main
  • Loading branch information
rniwa committed Aug 29, 2023
1 parent df817db commit e2ae472
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Source/WebKit/UIProcess/GPU/GPUProcessProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,8 +721,8 @@ void GPUProcessProxy::updatePreferences(WebProcessProxy& webProcess)
// In practice, all web pages' preferences should agree on these feature flag values.
GPUProcessPreferences gpuPreferences;
for (auto page : webProcess.pages()) {
auto& webPreferences = page->preferences();
if (!webPreferences.useGPUProcessForMediaEnabled())
Ref webPreferences = page->preferences();
if (!webPreferences->useGPUProcessForMediaEnabled())
continue;
gpuPreferences.copyEnabledWebPreferences(webPreferences);
}
Expand Down
4 changes: 2 additions & 2 deletions Source/WebKit/UIProcess/Gamepad/UIGamepadProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ UIGamepadProvider::~UIGamepadProvider()

void UIGamepadProvider::gamepadSyncTimerFired()
{
auto webPageProxy = platformWebPageProxyForGamepadInput();
RefPtr webPageProxy = platformWebPageProxyForGamepadInput();
if (!webPageProxy || !m_processPoolsUsingGamepads.contains(&webPageProxy->process().processPool()))
return;

Expand Down Expand Up @@ -161,7 +161,7 @@ void UIGamepadProvider::viewBecameActive(WebPageProxy& page)

void UIGamepadProvider::viewBecameInactive(WebPageProxy& page)
{
auto pageForGamepadInput = platformWebPageProxyForGamepadInput();
RefPtr pageForGamepadInput = platformWebPageProxyForGamepadInput();
if (pageForGamepadInput == &page)
platformStopMonitoringInput();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,16 @@ HighPerformanceGraphicsUsageSampler::HighPerformanceGraphicsUsageSampler(WebProc
m_timer.startRepeating(samplingInterval);
}

HighPerformanceGraphicsUsageSampler::~HighPerformanceGraphicsUsageSampler() = default;

void HighPerformanceGraphicsUsageSampler::timerFired()
{
bool isUsingHighPerformanceWebGL = false;
bool isUsingHighPerformanceWebGLInVisibleView = false;

RefPtr<WebPageProxy> firstPage;
for (auto& webProcess : m_webProcessPool.processes()) {
Ref pool = m_webProcessPool.get();
for (auto& webProcess : pool->processes()) {
for (auto& page : webProcess->pages()) {
if (!page)
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ class HighPerformanceGraphicsUsageSampler {
WTF_MAKE_FAST_ALLOCATED;
public:
explicit HighPerformanceGraphicsUsageSampler(WebProcessPool&);
~HighPerformanceGraphicsUsageSampler();

private:
void timerFired();

WebProcessPool& m_webProcessPool;
CheckedRef<WebProcessPool> m_webProcessPool;
RunLoop::Timer m_timer;
};

Expand Down

0 comments on commit e2ae472

Please sign in to comment.