Skip to content

Commit

Permalink
Block "setMediaOverridesForTesting" media IPC endpoints when not test…
Browse files Browse the repository at this point in the history
…ing and instead reset values

https://bugs.webkit.org/show_bug.cgi?id=268731
rdar://122218365

Reviewed by Youenn Fablet.

The fix in https://commits.webkit.org/272448.445@safari-7618-branch was insufficient as
the setMediaOverridesForTesting IPC endpoints is also used to reset the flags to their default.

So rather than disabling the IPC endpoints altogether we restrict its use to only reset
the default values (which are all unset).

* Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp:
(WebKit::GPUConnectionToWebProcess::setMediaOverridesForTesting):
* Source/WebKit/GPUProcess/GPUConnectionToWebProcess.messages.in:

Originally-landed-as: 272448.473@safari-7618-branch (00b3f3c). rdar://124557967
Canonical link: https://commits.webkit.org/276185@main
  • Loading branch information
jyavenard authored and robert-jenner committed Mar 15, 2024
1 parent 17c0ad9 commit 5fb50e5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,16 @@ void GPUConnectionToWebProcess::releaseRemoteCommandListener(RemoteRemoteCommand

void GPUConnectionToWebProcess::setMediaOverridesForTesting(MediaOverridesForTesting overrides)
{
if (!allowTestOnlyIPC()) {
MESSAGE_CHECK(!overrides.systemHasAC && !overrides.systemHasBattery && !overrides.vp9HardwareDecoderDisabled && !overrides.vp9DecoderDisabled && !overrides.vp9ScreenSizeAndScale);
#if PLATFORM(COCOA)
#if ENABLE(VP9)
VP9TestingOverrides::singleton().resetOverridesToDefaultValues();
#endif
SystemBatteryStatusTestingOverrides::singleton().resetOverridesToDefaultValues();
#endif
return;
}
#if ENABLE(VP9) && PLATFORM(COCOA)
VP9TestingOverrides::singleton().setHardwareDecoderDisabled(WTFMove(overrides.vp9HardwareDecoderDisabled));
VP9TestingOverrides::singleton().setVP9DecoderDisabled(WTFMove(overrides.vp9DecoderDisabled));
Expand Down

0 comments on commit 5fb50e5

Please sign in to comment.