⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 254608 in webkit


Ignore:
Timestamp:
Jan 15, 2020, 11:15:37 AM (7 years ago)
Author:
Alan Coon
Message:

Cherry-pick r254288. rdar://problem/58548984

[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.

git-svn-id: ​https://svn.webkit.org/repository/webkit/trunk@254288 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-609-branch/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-609-branch/Source/WebCore/ChangeLog

    r254601 r254608  
     12020-01-14  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r254288. rdar://problem/58548984
     4
     5    [Cocoa] persistent-usage-record message fails first time; succeeds subsequent times
     6    https://bugs.webkit.org/show_bug.cgi?id=205970
     7    <rdar://problem/57785647>
     8   
     9    Reviewed by Eric Carlson.
     10   
     11    The AVContentKeySession is created too early; before the CDM has a chance to provide the storage path
     12    for persistent usage records. Delay creation of the AVCKS until it's actually needed during the first
     13    license request.
     14   
     15    Drive-by fix: fix the exceptional case where a PUR session is closed but PUR data isn't available; send
     16    a null message rather than an empty array.
     17   
     18    * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
     19    * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
     20    (WebCore::CDMInstanceFairPlayStreamingAVFObjC::contentKeySession):
     21    (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
     22    (WebCore::CDMInstanceFairPlayStreamingAVFObjC::CDMInstanceFairPlayStreamingAVFObjC): Deleted.
     23    (WebCore::CDMInstanceFairPlayStreamingAVFObjC::ensureSession): Deleted.
     24   
     25   
     26    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254288 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     27
     28    2020-01-09  Jer Noble  <jer.noble@apple.com>
     29
     30            [Cocoa] persistent-usage-record message fails first time; succeeds subsequent times
     31            https://bugs.webkit.org/show_bug.cgi?id=205970
     32            <rdar://problem/57785647>
     33
     34            Reviewed by Eric Carlson.
     35
     36            The AVContentKeySession is created too early; before the CDM has a chance to provide the storage path
     37            for persistent usage records. Delay creation of the AVCKS until it's actually needed during the first
     38            license request.
     39
     40            Drive-by fix: fix the exceptional case where a PUR session is closed but PUR data isn't available; send
     41            a null message rather than an empty array.
     42
     43            * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
     44            * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
     45            (WebCore::CDMInstanceFairPlayStreamingAVFObjC::contentKeySession):
     46            (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
     47            (WebCore::CDMInstanceFairPlayStreamingAVFObjC::CDMInstanceFairPlayStreamingAVFObjC): Deleted.
     48            (WebCore::CDMInstanceFairPlayStreamingAVFObjC::ensureSession): Deleted.
     49
    1502020-01-14  Alan Coon  <alancoon@apple.com>
    251
  • branches/safari-609-branch/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h

    r253064 r254608  
    8888    bool persistentStateAllowed() const { return m_persistentStateAllowed; }
    8989    SharedBuffer* serverCertificate() const { return m_serverCertificate.get(); }
    90     AVContentKeySession* contentKeySession() { return m_session.get(); }
     90    AVContentKeySession* contentKeySession();
    9191
    9292    // AVContentKeySessionDelegateClient
    … …  
    107107
    108108private:
    109     void ensureSession();
    110 
    111109    RetainPtr<AVContentKeySession> m_session;
    112110    RetainPtr<WebCoreFPSContentKeySessionDelegate> m_delegate;
  • branches/safari-609-branch/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm

    r253852 r254608  
    160160namespace WebCore {
    161161
    162 CDMInstanceFairPlayStreamingAVFObjC::CDMInstanceFairPlayStreamingAVFObjC()
    163 {
    164     if (PAL::getAVContentKeyReportGroupClass())
    165         ensureSession();
    166 }
    167 
    168 void CDMInstanceFairPlayStreamingAVFObjC::ensureSession()
     162CDMInstanceFairPlayStreamingAVFObjC::CDMInstanceFairPlayStreamingAVFObjC() = default;
     163
     164AVContentKeySession* CDMInstanceFairPlayStreamingAVFObjC::contentKeySession()
    169165{
    170166    if (m_session)
    171         return;
     167        return m_session.get();
    172168
    173169    if (!PAL::canLoad_AVFoundation_AVContentKeySystemFairPlayStreaming())
    174         return;
     170        return nullptr;
     171
     172    if (!PAL::getAVContentKeyReportGroupClass())
     173        return nullptr;
    175174
    176175    auto storageURL = this->storageURL();
    … …  
    181180
    182181    if (!m_session)
    183         return;
     182        return nullptr;
    184183
    185184    if (!m_delegate)
    … …  
    187186
    188187    [m_session setDelegate:m_delegate.get() queue:dispatch_get_main_queue()];
     188    return m_session.get();
    189189}
    190190
    … …  
    817817        }
    818818
     819        if (!expiredSessionsArray.get().count) {
     820            callback(WTFMove(changedKeys), WTF::nullopt, Succeeded);
     821            return;
     822        }
     823
    819824        RetainPtr<NSData> expiredSessionsData = [NSPropertyListSerialization dataWithPropertyList:expiredSessionsArray.get() format:NSPropertyListBinaryFormat_v1_0 options:kCFPropertyListImmutable error:nullptr];
    820825
Note: See TracChangeset for help on using the changeset viewer.