Changeset 195335 in webkit


Ignore:
Timestamp:
Jan 19, 2016 7:50:50 PM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r195302.
https://bugs.webkit.org/show_bug.cgi?id=153267

This change broke the Windows build, rolling out so it isn't
broken all night before investigation. (Requested by
ryanhaddad on #webkit).

Reverted changeset:

"[EME] Correctly report errors when generating key requests
from AVContentKeySession."
https://bugs.webkit.org/show_bug.cgi?id=151963
http://trac.webkit.org/changeset/195302

Location:
trunk/Source/WebCore
Files:
2 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r195322 r195335  
     12016-01-19  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r195302.
     4        https://bugs.webkit.org/show_bug.cgi?id=153267
     5
     6        This change broke the Windows build, rolling out so it isn't
     7        broken all night before investigation. (Requested by
     8        ryanhaddad on #webkit).
     9
     10        Reverted changeset:
     11
     12        "[EME] Correctly report errors when generating key requests
     13        from AVContentKeySession."
     14        https://bugs.webkit.org/show_bug.cgi?id=151963
     15        http://trac.webkit.org/changeset/195302
     16
    1172016-01-19  Chris Dumez  <cdumez@apple.com>
    218
  • trunk/Source/WebCore/Modules/encryptedmedia/CDM.h

    r195302 r195335  
    5656    explicit CDM(const String& keySystem);
    5757
    58     enum CDMErrorCode { NoError, UnknownError, ClientError, ServiceError, OutputError, HardwareChangeError, DomainError };
     58    enum CDMErrorCode { UnknownError = 1, ClientError, ServiceError, OutputError, HardwareChangeError, DomainError };
    5959    static bool supportsKeySystem(const String&);
    6060    static bool keySystemSupportsMimeType(const String& keySystem, const String& mimeType);
  • trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.cpp

    r195302 r195335  
    7070}
    7171
    72 RefPtr<Uint8Array> CDMSessionClearKey::generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode)
     72RefPtr<Uint8Array> CDMSessionClearKey::generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, unsigned long& systemCode)
    7373{
    7474    UNUSED_PARAM(mimeType);
     
    9797}
    9898
    99 bool CDMSessionClearKey::update(Uint8Array* rawKeysData, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, uint32_t& systemCode)
     99bool CDMSessionClearKey::update(Uint8Array* rawKeysData, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode)
    100100{
    101101    UNUSED_PARAM(nextMessage);
  • trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.h

    r195302 r195335  
    4343    virtual void setClient(CDMSessionClient* client) override { m_client = client; }
    4444    virtual const String& sessionId() const override { return m_sessionId; }
    45     virtual RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array*, String&, unsigned short&, uint32_t&) override;
     45    virtual RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array*, String&, unsigned short&, unsigned long&) override;
    4646    virtual void releaseKeys() override;
    47     virtual bool update(Uint8Array*, RefPtr<Uint8Array>&, unsigned short&, uint32_t&) override;
     47    virtual bool update(Uint8Array*, RefPtr<Uint8Array>&, unsigned short&, unsigned long&) override;
    4848    virtual RefPtr<ArrayBuffer> cachedKeyForKeyID(const String&) const override;
    4949
  • trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp

    r195302 r195335  
    112112        String destinationURL;
    113113        MediaKeyError::Code errorCode = 0;
    114         uint32_t systemCode = 0;
     114        unsigned long systemCode = 0;
    115115
    116116        // 3. Use cdm to generate a key request and follow the steps for the first matching condition from the following list:
     
    164164        RefPtr<Uint8Array> pendingKey = m_pendingKeys.takeFirst();
    165165        unsigned short errorCode = 0;
    166         uint32_t systemCode = 0;
     166        unsigned long systemCode = 0;
    167167
    168168        // NOTE: Continued from step 2. of MediaKeySession::update()
     
    220220}
    221221
    222 void MediaKeySession::sendError(CDMSessionClient::MediaKeyErrorCode errorCode, uint32_t systemCode)
     222void MediaKeySession::sendError(CDMSessionClient::MediaKeyErrorCode errorCode, unsigned long systemCode)
    223223{
    224224    Ref<MediaKeyError> error = MediaKeyError::create(errorCode, systemCode).get();
  • trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h

    r195302 r195335  
    8787    // CDMSessionClient
    8888    virtual void sendMessage(Uint8Array*, String destinationURL) override;
    89     virtual void sendError(MediaKeyErrorCode, uint32_t systemCode) override;
     89    virtual void sendError(MediaKeyErrorCode, unsigned long systemCode) override;
    9090    virtual String mediaKeysStorageDirectory() const override;
    9191
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r195317 r195335  
    60696069                CDC8B5AB18047FF10016E685 /* SourceBufferPrivateAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC8B5A918047FF10016E685 /* SourceBufferPrivateAVFObjC.h */; };
    60706070                CDC8B5AD1804AE5D0016E685 /* SourceBufferPrivateClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC8B5AC1804AE5D0016E685 /* SourceBufferPrivateClient.h */; };
    6071                 CDC979F41C498C0900DB50D4 /* WebCoreNSErrorExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDC979F21C498C0900DB50D4 /* WebCoreNSErrorExtras.mm */; };
    6072                 CDC979F51C498C0900DB50D4 /* WebCoreNSErrorExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC979F31C498C0900DB50D4 /* WebCoreNSErrorExtras.h */; };
    60736071                CDCA82961679100F00875714 /* TextTrackRepresentationIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDCA82941679100F00875714 /* TextTrackRepresentationIOS.mm */; };
    60746072                CDCA98EB18B2C8EB00C12FF9 /* CDMPrivateMediaPlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDCA98EA18B2C8EB00C12FF9 /* CDMPrivateMediaPlayer.cpp */; };
     
    1395013948                CDC8B5A918047FF10016E685 /* SourceBufferPrivateAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceBufferPrivateAVFObjC.h; sourceTree = "<group>"; };
    1395113949                CDC8B5AC1804AE5D0016E685 /* SourceBufferPrivateClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceBufferPrivateClient.h; sourceTree = "<group>"; };
    13952                 CDC979F21C498C0900DB50D4 /* WebCoreNSErrorExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreNSErrorExtras.mm; sourceTree = "<group>"; };
    13953                 CDC979F31C498C0900DB50D4 /* WebCoreNSErrorExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreNSErrorExtras.h; sourceTree = "<group>"; };
    1395413950                CDCA82941679100F00875714 /* TextTrackRepresentationIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TextTrackRepresentationIOS.mm; sourceTree = "<group>"; };
    1395513951                CDCA98E918B2C8D000C12FF9 /* CDMPrivateMediaPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMPrivateMediaPlayer.h; sourceTree = "<group>"; };
     
    1975319749                                310D71941B335C9D009C7B73 /* ThemeCocoa.h */,
    1975419750                                46DB7D561B20FE3C005651B2 /* VNodeTrackerCocoa.cpp */,
    19755                                 CDC979F21C498C0900DB50D4 /* WebCoreNSErrorExtras.mm */,
    19756                                 CDC979F31C498C0900DB50D4 /* WebCoreNSErrorExtras.h */,
    1975719751                        );
    1975819752                        path = cocoa;
     
    2664426638                                BC5EBA110E823E4700B25965 /* KeyframeList.h in Headers */,
    2664526639                                E15FF7D518C9553800FE4C87 /* KeypressCommand.h in Headers */,
    26646                                 CDC979F51C498C0900DB50D4 /* WebCoreNSErrorExtras.h in Headers */,
    2664726640                                521D46F811AEC9B100514613 /* KillRing.h in Headers */,
    2664826641                                450CEBF115073BBE002BB149 /* LabelableElement.h in Headers */,
     
    2884828841                                BC274B31140EBED800EADFA6 /* CSSBorderImageSliceValue.cpp in Sources */,
    2884928842                                49AE2D8E134EE50C0072920A /* CSSCalculationValue.cpp in Sources */,
    28850                                 CDC979F41C498C0900DB50D4 /* WebCoreNSErrorExtras.mm in Sources */,
    2885128843                                BC604A430DB5634E00204739 /* CSSCanvasValue.cpp in Sources */,
    2885228844                                E1EBBBD40AAC9B87001FE8E2 /* CSSCharsetRule.cpp in Sources */,
  • trunk/Source/WebCore/html/MediaKeyError.h

    r195302 r195335  
    4747    typedef unsigned short Code;
    4848
    49     static Ref<MediaKeyError> create(Code code, uint32_t systemCode = 0) { return adoptRef(*new MediaKeyError(code, systemCode)); }
     49    static Ref<MediaKeyError> create(Code code, unsigned long systemCode = 0) { return adoptRef(*new MediaKeyError(code, systemCode)); }
    5050
    5151    Code code() const { return m_code; }
    52     uint32_t systemCode() { return m_systemCode; }
     52    unsigned long systemCode() { return m_systemCode; }
    5353
    5454private:
  • trunk/Source/WebCore/html/MediaKeyEvent.h

    r195302 r195335  
    4343    String defaultURL;
    4444    RefPtr<MediaKeyError> errorCode;
    45     uint32_t systemCode;
     45    unsigned short systemCode;
    4646};
    4747
  • trunk/Source/WebCore/platform/graphics/CDMSession.h

    r195302 r195335  
    5050    };
    5151    typedef unsigned short MediaKeyErrorCode;
    52     virtual void sendError(MediaKeyErrorCode, uint32_t systemCode) = 0;
     52    virtual void sendError(MediaKeyErrorCode, unsigned long systemCode) = 0;
    5353
    5454    virtual String mediaKeysStorageDirectory() const = 0;
     
    7171    virtual void setClient(CDMSessionClient*) = 0;
    7272    virtual const String& sessionId() const = 0;
    73     virtual RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode) = 0;
     73    virtual RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, unsigned long& systemCode) = 0;
    7474    virtual void releaseKeys() = 0;
    75     virtual bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, uint32_t& systemCode) = 0;
     75    virtual bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode) = 0;
    7676    virtual RefPtr<ArrayBuffer> cachedKeyForKeyID(const String&) const { return nullptr; }
    7777};
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h

    r195302 r195335  
    5050    // CDMSession
    5151    virtual CDMSessionType type() override { return CDMSessionTypeAVContentKeySession; }
    52     virtual RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode) override;
     52    virtual RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, unsigned long& systemCode) override;
    5353    virtual void releaseKeys() override;
    54     virtual bool update(Uint8Array* key, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, uint32_t& systemCode) override;
     54    virtual bool update(Uint8Array* key, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode) override;
    5555
    5656    // CDMSessionMediaSourceAVFObjC
     
    6161
    6262protected:
    63     PassRefPtr<Uint8Array> generateKeyReleaseMessage(unsigned short& errorCode, uint32_t& systemCode);
     63    PassRefPtr<Uint8Array> generateKeyReleaseMessage(unsigned short& errorCode, unsigned long& systemCode);
    6464
    6565    bool hasContentKeySession() const { return m_contentKeySession; }
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm

    r195302 r195335  
    3838#import "SourceBufferPrivateAVFObjC.h"
    3939#import "UUID.h"
    40 #import "WebCoreNSErrorExtras.h"
    4140#import <AVFoundation/AVError.h>
    4241#import <CoreMedia/CMBase.h>
     42#import <cstdlib>
    4343#import <objc/objc-runtime.h>
    4444#import <runtime/TypedArrayInlines.h>
     
    145145}
    146146
    147 RefPtr<Uint8Array> CDMSessionAVContentKeySession::generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode)
     147RefPtr<Uint8Array> CDMSessionAVContentKeySession::generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, unsigned long& systemCode)
    148148{
    149149    UNUSED_PARAM(mimeType);
     
    229229}
    230230
    231 bool CDMSessionAVContentKeySession::update(Uint8Array* key, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, uint32_t& systemCode)
     231bool CDMSessionAVContentKeySession::update(Uint8Array* key, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode)
    232232{
    233233    UNUSED_PARAM(nextMessage);
     
    282282        errorCode = MediaPlayer::NoError;
    283283        systemCode = 0;
    284         NSError* error = nil;
    285         NSData* requestData = [m_keyRequest contentKeyRequestDataForApp:certificateData.get() contentIdentifier:nil options:options.get() error:&error];
    286         if (error) {
    287             errorCode = MediaPlayerClient::DomainError;
    288             systemCode = mediaKeyErrorSystemCode(error);
    289             return false;
    290         }
    291 
     284        NSData* requestData = [m_keyRequest contentKeyRequestDataForApp:certificateData.get() contentIdentifier:nil options:options.get() error:nil];
    292285        nextMessage = Uint8Array::create(static_cast<const uint8_t*>([requestData bytes]), [requestData length]);
     286
    293287        return false;
    294288    }
     
    313307}
    314308
    315 PassRefPtr<Uint8Array> CDMSessionAVContentKeySession::generateKeyReleaseMessage(unsigned short& errorCode, uint32_t& systemCode)
     309PassRefPtr<Uint8Array> CDMSessionAVContentKeySession::generateKeyReleaseMessage(unsigned short& errorCode, unsigned long& systemCode)
    316310{
    317311    ASSERT(m_mode == KeyRelease);
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h

    r195302 r195335  
    4646    virtual void setClient(CDMSessionClient* client) override { m_client = client; }
    4747    virtual const String& sessionId() const override { return m_sessionId; }
    48     virtual RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode) override;
     48    virtual RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, unsigned long& systemCode) override;
    4949    virtual void releaseKeys() override;
    50     virtual bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, uint32_t& systemCode) override;
     50    virtual bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode) override;
    5151
    5252protected:
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm

    r195302 r195335  
    3636#import "SoftLinking.h"
    3737#import "UUID.h"
    38 #import "WebCoreNSErrorExtras.h"
    3938#import <AVFoundation/AVFoundation.h>
    4039#import <objc/objc-runtime.h>
     
    5554}
    5655
    57 RefPtr<Uint8Array> CDMSessionAVFoundationObjC::generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode)
     56RefPtr<Uint8Array> CDMSessionAVFoundationObjC::generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, unsigned long& systemCode)
    5857{
    5958    UNUSED_PARAM(mimeType);
     
    6362    RefPtr<Uint8Array> certificate;
    6463    if (!MediaPlayerPrivateAVFoundationObjC::extractKeyURIKeyIDAndCertificateFromInitData(initData, keyURI, keyID, certificate)) {
    65         errorCode = CDM::UnknownError;
     64        errorCode = MediaPlayer::InvalidPlayerState;
    6665        return nullptr;
    6766    }
     
    6968    m_request = m_parent->takeRequestForKeyURI(keyURI);
    7069    if (!m_request) {
    71         errorCode = CDM::UnknownError;
     70        errorCode = MediaPlayer::InvalidPlayerState;
    7271        return nullptr;
    7372    }
     
    8079
    8180    if (!keyRequest) {
    82         errorCode = CDM::DomainError;
    83         systemCode = mediaKeyErrorSystemCode(nsError);
     81        NSError* underlyingError = [[nsError userInfo] objectForKey:NSUnderlyingErrorKey];
     82        systemCode = [underlyingError code];
    8483        return nullptr;
    8584    }
     
    9796}
    9897
    99 bool CDMSessionAVFoundationObjC::update(Uint8Array* key, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, uint32_t& systemCode)
     98bool CDMSessionAVFoundationObjC::update(Uint8Array* key, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode)
    10099{
    101100    RetainPtr<NSData> keyData = adoptNS([[NSData alloc] initWithBytes:key->baseAddress() length:key->byteLength()]);
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h

    r195302 r195335  
    4848    // CDMSession
    4949    virtual CDMSessionType type() override { return CDMSessionTypeAVStreamSession; }
    50     virtual RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode) override;
     50    virtual RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, unsigned long& systemCode) override;
    5151    virtual void releaseKeys() override;
    52     virtual bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, uint32_t& systemCode) override;
     52    virtual bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode) override;
    5353
    5454    // CDMSessionMediaSourceAVFObjC
     
    5959
    6060protected:
    61     PassRefPtr<Uint8Array> generateKeyReleaseMessage(unsigned short& errorCode, uint32_t systemCode);
     61    PassRefPtr<Uint8Array> generateKeyReleaseMessage(unsigned short& errorCode, unsigned long& systemCode);
    6262
    6363    WeakPtrFactory<CDMSessionAVStreamSession> m_weakPtrFactory;
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm

    r195302 r195335  
    3838#import "SourceBufferPrivateAVFObjC.h"
    3939#import "UUID.h"
    40 #import "WebCoreNSErrorExtras.h"
    4140#import <AVFoundation/AVError.h>
    4241#import <CoreMedia/CMBase.h>
     42#import <cstdlib>
    4343#import <objc/objc-runtime.h>
    4444#import <runtime/TypedArrayInlines.h>
     
    113113}
    114114
    115 RefPtr<Uint8Array> CDMSessionAVStreamSession::generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode)
     115RefPtr<Uint8Array> CDMSessionAVStreamSession::generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, unsigned long& systemCode)
    116116{
    117117    UNUSED_PARAM(mimeType);
     
    188188}
    189189
    190 bool CDMSessionAVStreamSession::update(Uint8Array* key, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, uint32_t& systemCode)
     190bool CDMSessionAVStreamSession::update(Uint8Array* key, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode)
    191191{
    192192    bool shouldGenerateKeyRequest = !m_certificate || isEqual(key, "renew");
     
    256256            LOG(Media, "CDMSessionAVStreamSession::update(%p) - error:%@", this, [error description]);
    257257            errorCode = MediaPlayer::InvalidPlayerState;
    258             systemCode = mediaKeyErrorSystemCode(error);
     258            systemCode = std::abs(systemCodeForError(error));
    259259            return false;
    260260        }
     
    305305}
    306306
    307 PassRefPtr<Uint8Array> CDMSessionAVStreamSession::generateKeyReleaseMessage(unsigned short& errorCode, uint32_t systemCode)
     307PassRefPtr<Uint8Array> CDMSessionAVStreamSession::generateKeyReleaseMessage(unsigned short& errorCode, unsigned long& systemCode)
    308308{
    309309    ASSERT(m_mode == KeyRelease);
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h

    r195302 r195335  
    6464
    6565protected:
     66    static long systemCodeForError(NSError *);
    6667    String storagePath() const;
    6768
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm

    r195302 r195335  
    3131#import "CDMPrivateMediaSourceAVFObjC.h"
    3232#import "FileSystem.h"
    33 #import "WebCoreNSErrorExtras.h"
    3433#import <AVFoundation/AVError.h>
     34#import <cstdlib>
    3535
    3636namespace WebCore {
     
    5353        return;
    5454
    55     unsigned long code = mediaKeyErrorSystemCode(error);
     55    unsigned long code = std::abs(systemCodeForError(error));
    5656
    5757    // FIXME(142246): Remove the following once <rdar://problem/20027434> is resolved.
     
    6666        return;
    6767
    68     unsigned long code = mediaKeyErrorSystemCode(error);
     68    unsigned long code = std::abs(systemCodeForError(error));
    6969
    7070    // FIXME(142246): Remove the following once <rdar://problem/20027434> is resolved.
     
    9797}
    9898
     99long CDMSessionMediaSourceAVFObjC::systemCodeForError(NSError *error)
     100{
     101    NSInteger code = [error code];
     102    if (code != AVErrorUnknown)
     103        return code;
     104
     105    NSError* underlyingError = [error.userInfo valueForKey:NSUnderlyingErrorKey];
     106    if (!underlyingError || ![underlyingError isKindOfClass:[NSError class]])
     107        return code;
     108
     109    return [underlyingError code];
     110}
     111
    99112String CDMSessionMediaSourceAVFObjC::storagePath() const
    100113{
  • trunk/Source/WebCore/testing/MockCDM.cpp

    r195302 r195335  
    4545    virtual void setClient(CDMSessionClient* client) override { m_client = client; }
    4646    virtual const String& sessionId() const override { return m_sessionId; }
    47     virtual RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode) override;
     47    virtual RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, unsigned long& systemCode) override;
    4848    virtual void releaseKeys() override;
    49     virtual bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, uint32_t& systemCode) override;
     49    virtual bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode) override;
    5050
    5151protected:
     
    113113}
    114114
    115 RefPtr<Uint8Array> MockCDMSession::generateKeyRequest(const String&, Uint8Array* initData, String&, unsigned short& errorCode, uint32_t&)
     115RefPtr<Uint8Array> MockCDMSession::generateKeyRequest(const String&, Uint8Array* initData, String&, unsigned short& errorCode, unsigned long&)
    116116{
    117117    for (unsigned i = 0; i < initDataPrefix()->length(); ++i) {
     
    129129}
    130130
    131 bool MockCDMSession::update(Uint8Array* key, RefPtr<Uint8Array>&, unsigned short& errorCode, uint32_t&)
     131bool MockCDMSession::update(Uint8Array* key, RefPtr<Uint8Array>&, unsigned short& errorCode, unsigned long&)
    132132{
    133133    for (unsigned i = 0; i < keyPrefix()->length(); ++i) {
Note: See TracChangeset for help on using the changeset viewer.