Skip to content

Commit

Permalink
Cherry-pick 272448.473@safari-7618-branch (00b3f3c). https://bugs.web…
Browse files Browse the repository at this point in the history
…kit.org/show_bug.cgi?id=268731

    Block "setMediaOverridesForTesting" media IPC endpoints when not testing 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:

    Canonical link: https://commits.webkit.org/272448.473@safari-7618-branch

Canonical link: https://commits.webkit.org/266719.376@webkitglib/2.42
  • Loading branch information
jyavenard authored and aperezdc committed Mar 14, 2024
1 parent cdd65d7 commit 934077a
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 @@ -813,6 +813,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 934077a

Please sign in to comment.