Changeset 166509 in webkit


Ignore:
Timestamp:
Mar 31, 2014 9:43:32 AM (10 years ago)
Author:
jer.noble@apple.com
Message:

[MSE][Mac] Support lease-renewal.
https://bugs.webkit.org/show_bug.cgi?id=130919

Reviewed by Eric Carlson.

Trigger a new key request when receiving an update message containting "renew".

  • platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:

(WebCore::CDMSessionMediaSourceAVFObjC::generateKeyRequest): Drive-by fix; generate a UTF-8

based array.

(WebCore::CDMSessionMediaSourceAVFObjC::update):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r166507 r166509  
     12014-03-31  Jer Noble  <jer.noble@apple.com>
     2
     3        [MSE][Mac] Support lease-renewal.
     4        https://bugs.webkit.org/show_bug.cgi?id=130919
     5
     6        Reviewed by Eric Carlson.
     7
     8        Trigger a new key request when receiving an update message containting "renew".
     9
     10        * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
     11        (WebCore::CDMSessionMediaSourceAVFObjC::generateKeyRequest): Drive-by fix; generate a UTF-8
     12            based array.
     13        (WebCore::CDMSessionMediaSourceAVFObjC::update):
     14
    1152014-03-31  Alexey Proskuryakov  <ap@apple.com>
    216
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm

    r164656 r166509  
    3939#import <CoreMedia/CMBase.h>
    4040#import <objc/objc-runtime.h>
     41#import <wtf/NeverDestroyed.h>
    4142
    4243SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
     
    7475
    7576    String certificateString(ASCIILiteral("certificate"));
    76     RefPtr<ArrayBuffer> buffer = ArrayBuffer::create(certificateString.length(), 2);
    77     RefPtr<JSC::Uint16Array> array = JSC::Uint16Array::create(buffer, 0, certificateString.length());
     77    RefPtr<Uint8Array> array = Uint8Array::create(certificateString.length());
    7878    for (unsigned i = 0, length = certificateString.length(); i < length; ++i)
    7979        array->set(i, certificateString[i]);
    80     return Uint8Array::create(buffer, 0, buffer->byteLength());
     80    return array;
    8181}
    8282
     
    111111    }
    112112
     113    static NeverDestroyed<String> renewMessage("renew");
     114    String keyAsString(key->data(), key->length());
     115
     116    if (keyAsString == renewMessage) {
     117        [m_parent->parser() renewExpiringContentKeyResponseDataForTrackID:m_parent->protectedTrackID()];
     118        return true;
     119    }
     120
    113121    LOG(Media, "CDMSessionMediaSourceAVFObjC::update(%p) - key data", this);
    114122    errorCode = MediaPlayer::NoError;
Note: See TracChangeset for help on using the changeset viewer.