Skip to content

[Cocoa] Use mediaKeysHashSalt() in more places#42641

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
jernoble:eng/Cocoa-Use-mediaKeysHashSalt-in-more-places
Mar 19, 2025
Merged

[Cocoa] Use mediaKeysHashSalt() in more places#42641
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
jernoble:eng/Cocoa-Use-mediaKeysHashSalt-in-more-places

Conversation

@jernoble
Copy link
Contributor

@jernoble jernoble commented Mar 18, 2025

0bba38c

[Cocoa] Use mediaKeysHashSalt() in more places
rdar://146422515
https://bugs.webkit.org/show_bug.cgi?id=289987

Reviewed by Andy Estes.

Use mediaKeysHashSalt() in all the places where -[AVContentKeyRequest
makeStreamingContentKeyRequestDataForApp:contentIdentifier:options:completionHandler:]
is called, by adding a static method optionsForKeyRequestWithHashSalt() which can
be used in both CDMInstanceFairPlayStreamingAVFObjC as well as CDMSessionAVContentKeySession.

To make mediaKeyHashSalt() avalable in the LegacyCDMSession codepath, make legacy requests take the same
trip through MediaKeySystemRequest.

* Source/WebCore/Modules/encryptedmedia/MediaKeySystemRequest.cpp:
(WebCore::MediaKeySystemRequest::create):
(WebCore::MediaKeySystemRequest::MediaKeySystemRequest):
(WebCore::MediaKeySystemRequest::deny):
* Source/WebCore/Modules/encryptedmedia/MediaKeySystemRequest.h:
(WebCore::MediaKeySystemRequest::setAllowCallback):
* Source/WebCore/Modules/encryptedmedia/NavigatorEME.cpp:
(WebCore::NavigatorEME::requestMediaKeySystemAccess):
(WebCore::tryNextSupportedConfiguration):
* Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::generateKeyRequest):
* Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
* Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
(WebCore::WebKitMediaKeys::createSession):
* Source/WebCore/platform/graphics/LegacyCDMSession.h:
* Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
* Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequests):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::optionsForKeyRequestWithHashSalt):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
* Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::update):
* Source/WebKit/GPUProcess/media/RemoteLegacyCDMSessionProxy.cpp:
(WebKit::RemoteLegacyCDMSessionProxy::generateKeyRequest):
* Source/WebKit/GPUProcess/media/RemoteLegacyCDMSessionProxy.h:
* Source/WebKit/GPUProcess/media/RemoteLegacyCDMSessionProxy.messages.in:
* Source/WebKit/WebProcess/GPU/media/RemoteLegacyCDMSession.cpp:
(WebKit::RemoteLegacyCDMSession::generateKeyRequest):

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

0d201d9

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ✅ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ❌ 🧪 api-wpe
💥 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@jernoble jernoble requested a review from cdumez as a code owner March 18, 2025 19:45
@jernoble jernoble self-assigned this Mar 18, 2025
@jernoble jernoble added the Media Bugs related to the HTML 5 Media elements. label Mar 18, 2025
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Mar 18, 2025
@jernoble jernoble removed the merging-blocked Applied to prevent a change from being merged label Mar 18, 2025
@jernoble jernoble force-pushed the eng/Cocoa-Use-mediaKeysHashSalt-in-more-places branch from 27d51a4 to 0d201d9 Compare March 18, 2025 20:56
@jernoble jernoble added the merge-queue Applied to send a pull request to merge-queue label Mar 19, 2025
rdar://146422515
https://bugs.webkit.org/show_bug.cgi?id=289987

Reviewed by Andy Estes.

Use mediaKeysHashSalt() in all the places where -[AVContentKeyRequest
makeStreamingContentKeyRequestDataForApp:contentIdentifier:options:completionHandler:]
is called, by adding a static method optionsForKeyRequestWithHashSalt() which can
be used in both CDMInstanceFairPlayStreamingAVFObjC as well as CDMSessionAVContentKeySession.

To make mediaKeyHashSalt() avalable in the LegacyCDMSession codepath, make legacy requests take the same
trip through MediaKeySystemRequest.

* Source/WebCore/Modules/encryptedmedia/MediaKeySystemRequest.cpp:
(WebCore::MediaKeySystemRequest::create):
(WebCore::MediaKeySystemRequest::MediaKeySystemRequest):
(WebCore::MediaKeySystemRequest::deny):
* Source/WebCore/Modules/encryptedmedia/MediaKeySystemRequest.h:
(WebCore::MediaKeySystemRequest::setAllowCallback):
* Source/WebCore/Modules/encryptedmedia/NavigatorEME.cpp:
(WebCore::NavigatorEME::requestMediaKeySystemAccess):
(WebCore::tryNextSupportedConfiguration):
* Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::generateKeyRequest):
* Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
* Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
(WebCore::WebKitMediaKeys::createSession):
* Source/WebCore/platform/graphics/LegacyCDMSession.h:
* Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
* Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequests):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::optionsForKeyRequestWithHashSalt):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
* Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::update):
* Source/WebKit/GPUProcess/media/RemoteLegacyCDMSessionProxy.cpp:
(WebKit::RemoteLegacyCDMSessionProxy::generateKeyRequest):
* Source/WebKit/GPUProcess/media/RemoteLegacyCDMSessionProxy.h:
* Source/WebKit/GPUProcess/media/RemoteLegacyCDMSessionProxy.messages.in:
* Source/WebKit/WebProcess/GPU/media/RemoteLegacyCDMSession.cpp:
(WebKit::RemoteLegacyCDMSession::generateKeyRequest):

Canonical link: https://commits.webkit.org/292370@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Cocoa-Use-mediaKeysHashSalt-in-more-places branch from 0d201d9 to 0bba38c Compare March 19, 2025 19:02
@webkit-commit-queue
Copy link
Collaborator

Committed 292370@main (0bba38c): https://commits.webkit.org/292370@main

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

@webkit-commit-queue webkit-commit-queue merged commit 0bba38c into WebKit:main Mar 19, 2025
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Mar 19, 2025
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