[webkit-changes] [WebKit/WebKit] 419ca9: Fix synchronisation issue with setMediaOverridesFo...

Gavin noreply at github.com
Fri Mar 10 12:43:40 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 419ca9b090186afea80666a5f59f586e89ef29e2
      https://github.com/WebKit/WebKit/commit/419ca9b090186afea80666a5f59f586e89ef29e2
  Author: Gavin Phillips <gavin.p at apple.com>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    M LayoutTests/platform/mac-wk2/TestExpectations
    M Source/WebCore/platform/cocoa/SystemBattery.h
    M Source/WebCore/platform/cocoa/SystemBattery.mm
    M Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h
    M Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.mm
    M Source/WebCore/testing/Internals.cpp
    M Source/WebKit/WebProcess/GPU/GPUProcessConnection.cpp
    M Source/WebKit/WebProcess/GPU/GPUProcessConnection.h
    M Source/WebKit/WebProcess/WebProcess.cpp

  Log Message:
  -----------
  Fix synchronisation issue with setMediaOverridesForTesting state when a new WebContent process is used for testing
https://bugs.webkit.org/show_bug.cgi?id=253468
rdar://106328795

Reviewed by Brady Eidson.

This changes resolves a synchronisation issue which arose when a new WebContent
process was spawned for a media-source test after a previous test changed
the setMediaOverridesForTesting from the default values.

The way setMediaOverridesForTesting works is that a singleton state is
maintained in both the WebProcess and the GPUP. When you request an
update to setMediaOverridesForTesting, the new state is checked against
the current local state stored within the process. If the two states are
different, a CoreIPC message is dispatched to the GPUProcess to tell
it to update the GPU side configuration.

WKTR will spawn new WebProcesses if the prior WebProcess is not suitable
for the next test, the prior WebProcess crashed, etc. When a new WebProcess
is spawned, the override's state is set back to it's default values.
However, we never reset the GPUP side state in this case. This would lead
to flaky failures.

During Internals construction, we now force reset WebProcess & GPU side
state back to default values.

* Source/WebCore/platform/cocoa/SystemBattery.h:
* Source/WebCore/platform/cocoa/SystemBattery.mm:
(WebCore::SystemBatteryStatusTestingOverrides::setHasBattery):
(WebCore::SystemBatteryStatusTestingOverrides::setHasAC):
(WebCore::SystemBatteryStatusTestingOverrides::setConfigurationChangedCallback):
(WebCore::SystemBatteryStatusTestingOverrides::forceConfigurationUpdate):
* Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h:
* Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.mm:
(WebCore::VP9TestingOverrides::setHardwareDecoderDisabled):
(WebCore::VP9TestingOverrides::setVP9DecoderDisabled):
(WebCore::VP9TestingOverrides::setVP9ScreenSizeAndScale):
(WebCore::VP9TestingOverrides::setConfigurationChangedCallback):
(WebCore::VP9TestingOverrides::forceConfigurationUpdate):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::Internals):
* Source/WebKit/WebProcess/GPU/GPUProcessConnection.cpp:
(WebKit::GPUProcessConnection::updateMediaConfiguration):
* Source/WebKit/WebProcess/GPU/GPUProcessConnection.h:
* Source/WebKit/WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setUseGPUProcessForMedia):

Canonical link: https://commits.webkit.org/261520@main




More information about the webkit-changes mailing list