WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch for landing
bug-205970-20200108165011.patch (text/plain), 5.22 KB, created by
Jer Noble
on 2020-01-08 16:50:16 PST
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Jer Noble
Created:
2020-01-08 16:50:16 PST
Size:
5.22 KB
patch
obsolete
>Subversion Revision: 254081 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index f838bd270a18dafd92a29a6cafd4960970f8a138..efcd6030d433a79556cf071d34df36b0553b59d9 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,25 @@ >+2020-01-08 Jer Noble <jer.noble@apple.com> >+ >+ [Cocoa] persistent-usage-record message fails first time; succeeds subsequent times >+ https://bugs.webkit.org/show_bug.cgi?id=205970 >+ <rdar://problem/57785647> >+ >+ Reviewed by Eric Carlson. >+ >+ The AVContentKeySession is created too early; before the CDM has a chance to provide the storage path >+ for persistent usage records. Delay creation of the AVCKS until it's actually needed during the first >+ license request. >+ >+ Drive-by fix: fix the exceptional case where a PUR session is closed but PUR data isn't available; send >+ a null message rather than an empty array. >+ >+ * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h: >+ * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: >+ (WebCore::CDMInstanceFairPlayStreamingAVFObjC::contentKeySession): >+ (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData): >+ (WebCore::CDMInstanceFairPlayStreamingAVFObjC::CDMInstanceFairPlayStreamingAVFObjC): Deleted. >+ (WebCore::CDMInstanceFairPlayStreamingAVFObjC::ensureSession): Deleted. >+ > 2019-12-20 Jer Noble <jer.noble@apple.com> > > Add logging for Modern EME methods. >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h b/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h >index d416923e046771ffa64a44f5c4d060f3f0fa2652..4772fcb3236d39029534c46fb4f10299783e6cb6 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h >@@ -87,7 +87,7 @@ public: > NSURL *storageURL() const { return m_storageURL.get(); } > bool persistentStateAllowed() const { return m_persistentStateAllowed; } > SharedBuffer* serverCertificate() const { return m_serverCertificate.get(); } >- AVContentKeySession* contentKeySession() { return m_session.get(); } >+ AVContentKeySession* contentKeySession(); > > // AVContentKeySessionDelegateClient > void didProvideRequest(AVContentKeyRequest*) final; >@@ -106,8 +106,6 @@ public: > CDMInstanceSessionFairPlayStreamingAVFObjC* sessionForGroup(AVContentKeyReportGroup*) const; > > private: >- void ensureSession(); >- > RetainPtr<AVContentKeySession> m_session; > RetainPtr<WebCoreFPSContentKeySessionDelegate> m_delegate; > RefPtr<SharedBuffer> m_serverCertificate; >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm >index 16474fbfbec5649f8a84c02a3cf897537a836901..99728e44676075b54535875821191d746f915161 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm >@@ -159,19 +159,18 @@ @end > > namespace WebCore { > >-CDMInstanceFairPlayStreamingAVFObjC::CDMInstanceFairPlayStreamingAVFObjC() >-{ >- if (PAL::getAVContentKeyReportGroupClass()) >- ensureSession(); >-} >+CDMInstanceFairPlayStreamingAVFObjC::CDMInstanceFairPlayStreamingAVFObjC() = default; > >-void CDMInstanceFairPlayStreamingAVFObjC::ensureSession() >+AVContentKeySession* CDMInstanceFairPlayStreamingAVFObjC::contentKeySession() > { > if (m_session) >- return; >+ return m_session.get(); > > if (!PAL::canLoad_AVFoundation_AVContentKeySystemFairPlayStreaming()) >- return; >+ return nullptr; >+ >+ if (!PAL::getAVContentKeyReportGroupClass()) >+ return nullptr; > > auto storageURL = this->storageURL(); > if (!persistentStateAllowed() || !storageURL) >@@ -180,12 +179,13 @@ void CDMInstanceFairPlayStreamingAVFObjC::ensureSession() > m_session = [PAL::getAVContentKeySessionClass() contentKeySessionWithKeySystem:AVContentKeySystemFairPlayStreaming storageDirectoryAtURL:storageURL]; > > if (!m_session) >- return; >+ return nullptr; > > if (!m_delegate) > m_delegate = adoptNS([[WebCoreFPSContentKeySessionDelegate alloc] initWithParent:this]); > > [m_session setDelegate:m_delegate.get() queue:dispatch_get_main_queue()]; >+ return m_session.get(); > } > > class CDMInstanceSessionFairPlayStreamingAVFObjC::UpdateResponseCollector { >@@ -816,6 +816,11 @@ void CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData(const String& > } > } > >+ if (!expiredSessionsArray.get().count) { >+ callback(WTFMove(changedKeys), WTF::nullopt, Succeeded); >+ return; >+ } >+ > RetainPtr<NSData> expiredSessionsData = [NSPropertyListSerialization dataWithPropertyList:expiredSessionsArray.get() format:NSPropertyListBinaryFormat_v1_0 options:kCFPropertyListImmutable error:nullptr]; > > callback(WTFMove(changedKeys), SharedBuffer::create(expiredSessionsData.get()), Succeeded);
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 205970
:
387156
| 387162