WebKit Bugzilla
Attachment 360515 Details for
Bug 193984
: [Cocoa][EME] persistent-usage-record data not issued after MediaKeySession.remove()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193984-20190129154544.patch (text/plain), 5.53 KB, created by
Jer Noble
on 2019-01-29 15:45:45 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jer Noble
Created:
2019-01-29 15:45:45 PST
Size:
5.53 KB
patch
obsolete
>Subversion Revision: 240673 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 058026790c9ac8fc0de89260cfcec7d1e3eff2f8..2b783109d2aab79e8f8fe17383603d65caba1f3a 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,26 @@ >+2019-01-29 Jer Noble <jer.noble@apple.com> >+ >+ [Cocoa][EME] persistent-usage-record data not issued after MediaKeySession.remove() >+ https://bugs.webkit.org/show_bug.cgi?id=193984 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ MediaKeySession.sessionId is empty during the CDMInstance->requestLicense success callback handler. The >+ KVO notification that AVContentKeySession.contentProtectionSessionIdentifier changed isn't called until >+ after the -[AVContentKeyRequest makeStreamingContentKeyRequestDataForApp:contentIdentifier:options:completionHandler:] >+ completion handler is called. >+ >+ Explicitly ask for the -contentProtectionSessionIdentifier inside that handler, and just in case the sessionID >+ changes after that, add a new client callback method to notify the MediaKeySession that the ID has changed. >+ >+ * Modules/encryptedmedia/MediaKeySession.cpp: >+ (WebCore::MediaKeySession::sessionIdChanged): >+ * Modules/encryptedmedia/MediaKeySession.h: >+ * platform/encryptedmedia/CDMInstanceSession.h: >+ * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: >+ (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest): >+ (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest): >+ > 2019-01-22 Jer Noble <jer.noble@apple.com> > > [Cocoa] Media elements will restart network buffering just before suspending >diff --git a/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp b/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp >index 4bea9a0084bee6873298dd34bea37a04eaa69fda..7b38450d6e82da06ffb2b962a4e983b18ed1d932 100644 >--- a/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp >+++ b/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp >@@ -671,6 +671,11 @@ void MediaKeySession::sendMessage(CDMMessageType messageType, Ref<SharedBuffer>& > enqueueMessage(messageType, message); > } > >+void MediaKeySession::sessionIdChanged(const String& sessionId) >+{ >+ m_sessionId = sessionId; >+} >+ > void MediaKeySession::updateExpiration(double) > { > notImplemented(); >diff --git a/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h b/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h >index 35d8174268cab1d78d5f560b62b4009ba618524c..b64cab87f151d2596a11d0d6f342f0521f11ca17 100644 >--- a/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h >+++ b/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h >@@ -87,6 +87,7 @@ private: > // CDMInstanceSessionClient > void updateKeyStatuses(CDMInstanceSessionClient::KeyStatusVector&&) override; > void sendMessage(CDMMessageType, Ref<SharedBuffer>&& message) final; >+ void sessionIdChanged(const String&) final; > > // EventTarget > EventTargetInterface eventTargetInterface() const override { return MediaKeySessionEventTargetInterfaceType; } >diff --git a/Source/WebCore/platform/encryptedmedia/CDMInstanceSession.h b/Source/WebCore/platform/encryptedmedia/CDMInstanceSession.h >index 797a2f95dad9932cf3eb0d726f67a9045392a02d..8d12a018e5ac4a89d37bb52c425a74bb50ac1566 100644 >--- a/Source/WebCore/platform/encryptedmedia/CDMInstanceSession.h >+++ b/Source/WebCore/platform/encryptedmedia/CDMInstanceSession.h >@@ -47,6 +47,7 @@ public: > using KeyStatusVector = Vector<std::pair<Ref<SharedBuffer>, KeyStatus>>; > virtual void updateKeyStatuses(KeyStatusVector&&) = 0; > virtual void sendMessage(CDMMessageType, Ref<SharedBuffer>&& message) = 0; >+ virtual void sessionIdChanged(const String&) = 0; > }; > > class CDMInstanceSession : public RefCounted<CDMInstanceSession> { >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm >index e03475669af23942899e78c880a01b2d965cf6b2..c050520b35594d98251470449f9f00fc1260372e 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm >@@ -527,6 +527,8 @@ void CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest(AVContentKeyR > if (!weakThis) > return; > >+ sessionIdentifierChanged(m_session.get().contentProtectionSessionIdentifier); >+ > if (error && m_requestLicenseCallback) > m_requestLicenseCallback(SharedBuffer::create(), m_sessionId, false, Failed); > else if (m_requestLicenseCallback) >@@ -630,13 +632,12 @@ bool CDMInstanceSessionFairPlayStreamingAVFObjC::shouldRetryRequestForReason(AVC > > void CDMInstanceSessionFairPlayStreamingAVFObjC::sessionIdentifierChanged(NSData *sessionIdentifier) > { >- if (!sessionIdentifier) { >- m_sessionId = emptyString(); >+ auto sessionId = sessionIdentifier ? adoptNS([[NSString alloc] initWithData:sessionIdentifier encoding:NSUTF8StringEncoding]).get() : emptyString(); >+ if (m_sessionId == sessionId) > return; >- } > >- auto sessionIdentifierString = adoptNS([[NSString alloc] initWithData:sessionIdentifier encoding:NSUTF8StringEncoding]); >- m_sessionId = sessionIdentifierString.get(); >+ m_sessionId = sessionId; >+ m_client->sessionIdChanged(m_sessionId); > } > > static auto requestStatusToCDMStatus(AVContentKeyRequestStatus status)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193984
:
360515
|
360590