Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cac2e6433cf382126d1d9202d8e74180017df218
      
https://github.com/WebKit/WebKit/commit/cac2e6433cf382126d1d9202d8e74180017df218
  Author: Eric Carlson <eric.carl...@apple.com>
  Date:   2024-03-04 (Mon, 04 Mar 2024)

  Changed paths:
    M Source/WebCore/html/HTMLMediaElement.cpp
    M Source/WebCore/platform/graphics/MediaPlayer.cpp
    M 
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h
    M 
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm

  Log Message:
  -----------
  Legacy EME WebKitMediaKeys createSessions unknown error
https://bugs.webkit.org/show_bug.cgi?id=262874
rdar://116689080

Reviewed by Jer Noble.

If a media resource protected with the legacy EME API loads very quickly, the 
media player
in GPU process may try to generate a key request before the HTMLMediaElement in 
the web
process has signaled it is OK to continue after a key request. Have 
HTMLMediaElement
call player->setShouldContinueAfterKeyNeeded as soon as the media player is 
allocaged so
it will know before media data loading begins.

No new test added because the problem is extremely timing dependent and I was 
never able
to reproduce in a layout test.

* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::createMediaPlayer): Call 
updateShouldContinueAfterNeedKey.

* Source/WebCore/platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::loadWithNextMediaEngine): Call 
shouldWaitForLoadingOfResource.
(WebCore::MediaPlayer::setShouldContinueAfterKeyNeeded):

* 
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* 
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
 Add logging.
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource): 
Check
m_shouldContinueAfterKeyNeeded instead of calling up to the player.
(WebCore::MediaPlayerPrivateAVFoundationObjC::didCancelLoadingRequest): Add 
logging.
(WebCore::MediaPlayerPrivateAVFoundationObjC::didStopLoadingRequest): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldContinueAfterKeyNeeded): 
Check
m_shouldContinueAfterKeyNeeded instead of calling up to the player.
(WebCore::MediaPlayerPrivateAVFoundationObjC::keyAdded): Add logging.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to