Skip to content

[iOS] Stop using AVSystemController and AVAudioSession SPIs when media capability grants are enabled#22293

Merged
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
aestes:eng/iOS-Stop-using-AVSystemController-and-AVAudioSession-SPIs-when-media-capability-grants-are-enabled
Jan 5, 2024
Merged

[iOS] Stop using AVSystemController and AVAudioSession SPIs when media capability grants are enabled#22293
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
aestes:eng/iOS-Stop-using-AVSystemController-and-AVAudioSession-SPIs-when-media-capability-grants-are-enabled

Conversation

@aestes
Copy link
Copy Markdown
Contributor

@aestes aestes commented Jan 2, 2024

f0f4cef

[iOS] Stop using AVSystemController and AVAudioSession SPIs when media capability grants are enabled
https://bugs.webkit.org/show_bug.cgi?id=266975
rdar://115750175

Reviewed by Per Arne Vollan.

When media capability grants are enabled, setting the
AVSystemController_PIDToInheritApplicationStateFrom attribute on AVSystemController and calling
-[AVAudioSession setAuditTokensForProcessAssertion:error:] are no longer necessary. Plumbed the
MediaCapabilityGrantsEnabled web preference to the GPU process and avoided calling these SPIs when
the preference is activated. Added a WKPreferences SPI to deactivate the preference for use by
clients that are not yet ready to adopt media capability grants.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::mediaCapabilityGrantsEnabled):
(WebCore::PlatformMediaSessionManager::setMediaCapabilityGrantsEnabled):
* Source/WebCore/platform/audio/PlatformMediaSessionManager.h:
* Source/WebCore/platform/audio/ios/MediaSessionHelperIOS.mm:
(MediaSessionHelperIOS::providePresentingApplicationPID):
* Source/WebKit/GPUProcess/GPUProcess.cpp:
(WebKit::GPUProcess::updateGPUProcessPreferences):
* Source/WebKit/GPUProcess/GPUProcessPreferences.cpp:
(WebKit::GPUProcessPreferences::copyEnabledWebPreferences):
* Source/WebKit/GPUProcess/GPUProcessPreferences.h:
* Source/WebKit/GPUProcess/media/RemoteAudioSessionProxyManager.cpp:
(WebKit::RemoteAudioSessionProxyManager::updatePresentingProcesses):
* Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _mediaCapabilityGrantsEnabled]):
(-[WKPreferences _setMediaCapabilityGrantsEnabled:]):
* Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h:

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

65bfe58

Misc iOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 wincairo
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 gtk
✅ 🛠 🧪 jsc ✅ 🧪 api-ios ❌ 🧪 mac-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 🧪 jsc-arm64 ✅ 🛠 tv ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
✅ 🛠 tv-sim ✅ 🛠 jsc-armv7
✅ 🛠 🧪 merge ✅ 🛠 watch ✅ 🧪 jsc-armv7-tests
✅ 🛠 watch-sim

@aestes aestes requested a review from cdumez as a code owner January 2, 2024 01:34
@aestes aestes self-assigned this Jan 2, 2024
@aestes aestes added the Media Bugs related to the HTML 5 Media elements. label Jan 2, 2024
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jan 2, 2024
@aestes
Copy link
Copy Markdown
Contributor Author

aestes commented Jan 2, 2024

Test failure in tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-vertical-then-horizontal.html is unrelated

Copy link
Copy Markdown
Contributor

@pvollan pvollan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R=me.

@aestes aestes added merge-queue Applied to send a pull request to merge-queue and removed merging-blocked Applied to prevent a change from being merged labels Jan 5, 2024
…a capability grants are enabled

https://bugs.webkit.org/show_bug.cgi?id=266975
rdar://115750175

Reviewed by Per Arne Vollan.

When media capability grants are enabled, setting the
AVSystemController_PIDToInheritApplicationStateFrom attribute on AVSystemController and calling
-[AVAudioSession setAuditTokensForProcessAssertion:error:] are no longer necessary. Plumbed the
MediaCapabilityGrantsEnabled web preference to the GPU process and avoided calling these SPIs when
the preference is activated. Added a WKPreferences SPI to deactivate the preference for use by
clients that are not yet ready to adopt media capability grants.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::mediaCapabilityGrantsEnabled):
(WebCore::PlatformMediaSessionManager::setMediaCapabilityGrantsEnabled):
* Source/WebCore/platform/audio/PlatformMediaSessionManager.h:
* Source/WebCore/platform/audio/ios/MediaSessionHelperIOS.mm:
(MediaSessionHelperIOS::providePresentingApplicationPID):
* Source/WebKit/GPUProcess/GPUProcess.cpp:
(WebKit::GPUProcess::updateGPUProcessPreferences):
* Source/WebKit/GPUProcess/GPUProcessPreferences.cpp:
(WebKit::GPUProcessPreferences::copyEnabledWebPreferences):
* Source/WebKit/GPUProcess/GPUProcessPreferences.h:
* Source/WebKit/GPUProcess/media/RemoteAudioSessionProxyManager.cpp:
(WebKit::RemoteAudioSessionProxyManager::updatePresentingProcesses):
* Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _mediaCapabilityGrantsEnabled]):
(-[WKPreferences _setMediaCapabilityGrantsEnabled:]):
* Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h:

Canonical link: https://commits.webkit.org/272675@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/iOS-Stop-using-AVSystemController-and-AVAudioSession-SPIs-when-media-capability-grants-are-enabled branch from 65bfe58 to f0f4cef Compare January 5, 2024 06:56
@webkit-commit-queue
Copy link
Copy Markdown
Collaborator

Committed 272675@main (f0f4cef): https://commits.webkit.org/272675@main

Reviewed commits have been landed. Closing PR #22293 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit f0f4cef into WebKit:main Jan 5, 2024
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jan 5, 2024
@aestes aestes deleted the eng/iOS-Stop-using-AVSystemController-and-AVAudioSession-SPIs-when-media-capability-grants-are-enabled branch April 21, 2024 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Media Bugs related to the HTML 5 Media elements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants