Source/modules/encryptedmedia/MediaKeySession.cpp
// Queue a task to fire a simple event named keyadded at the MediaKeySession object.
Queue a task to fire a simple event named keyadded at the MediaKeySession object.
Queue a task to fire a simple event named keyadded at the MediaKeySession object .
void MediaKeySession::error(MediaKeyErrorCode errorCode, unsigned long systemCode)
{
    WTF_LOG(Media, "MediaKeySession::error: errorCode=%d, systemCode=%lu", errorCode, systemCode);
    MediaKeyError::Code mediaKeyErrorCode = MediaKeyError::MEDIA_KEYERR_UNKNOWN;
    switch (errorCode) {
    case MediaKeyErrorCodeUnknown:
        mediaKeyErrorCode = MediaKeyError::MEDIA_KEYERR_UNKNOWN;
        break;
    case MediaKeyErrorCodeClient:
        mediaKeyErrorCode = MediaKeyError::MEDIA_KEYERR_CLIENT;
        break;
    }
    m_error = MediaKeyError::create(mediaKeyErrorCode, systemCode);
    RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::error);
    event->setTarget(this);
    m_asyncEventQueue->enqueueEvent(event.release());
}
void MediaKeySession :: error ( MediaKeyErrorCode errorCode , unsigned long systemCode ) { WTF_LOG ( Media , " " , errorCode , systemCode ) ; MediaKeyError :: Code mediaKeyErrorCode = MediaKeyError :: MEDIA_KEYERR_UNKNOWN ; switch ( errorCode ) { case MediaKeyErrorCodeUnknown : mediaKeyErrorCode = MediaKeyError :: MEDIA_KEYERR_UNKNOWN ; break ; case MediaKeyErrorCodeClient : mediaKeyErrorCode = MediaKeyError :: MEDIA_KEYERR_CLIENT ; break ; } m_error = MediaKeyError :: create ( mediaKeyErrorCode , systemCode ) ; RefPtrWillBeRawPtr < Event > event = Event :: create ( EventTypeNames :: error ) ; event -> setTarget ( this ) ; m_asyncEventQueue -> enqueueEvent ( event . release ( ) ) ; }
Queue a task to fire a simple event named keyadded at the MediaKeySession object.
Queue a task to fire a simple event named keyadded at the MediaKeySession object .
// 1. Create a new MediaKeyError object with the following attributes: //    code = the appropriate MediaKeyError code //    systemCode = a Key System-specific value, if provided, and 0 otherwise // 2. Set the MediaKeySession object's error attribute to the error object created in the previous step. // 3. queue a task to fire a simple event named keyerror at the MediaKeySession object.