| Index: Source/modules/encryptedmedia/MediaKeySession.cpp
|
| diff --git a/Source/modules/encryptedmedia/MediaKeySession.cpp b/Source/modules/encryptedmedia/MediaKeySession.cpp
|
| index 47ae6f21d118ce2d82b89d82d7f62baab234d27a..78bcbc646f82471423e56354c7c9a281aa161dc9 100644
|
| --- a/Source/modules/encryptedmedia/MediaKeySession.cpp
|
| +++ b/Source/modules/encryptedmedia/MediaKeySession.cpp
|
| @@ -34,12 +34,15 @@
|
| #include "modules/encryptedmedia/MediaKeyMessageEvent.h"
|
| #include "modules/encryptedmedia/MediaKeys.h"
|
| #include "platform/Logging.h"
|
| -#include "platform/drm/ContentDecryptionModule.h"
|
| +#include "public/platform/WebContentDecryptionModule.h"
|
| +#include "public/platform/WebString.h"
|
| +#include "public/platform/WebURL.h"
|
|
|
| namespace WebCore {
|
|
|
| PassOwnPtr<MediaKeySession::PendingAction> MediaKeySession::PendingAction::CreatePendingUpdate(PassRefPtr<Uint8Array> data)
|
| {
|
| + ASSERT(data);
|
| return adoptPtr(new PendingAction(Update, data));
|
| }
|
|
|
| @@ -58,18 +61,18 @@ MediaKeySession::PendingAction::~PendingAction()
|
| {
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<MediaKeySession> MediaKeySession::create(ExecutionContext* context, ContentDecryptionModule* cdm, WeakPtr<MediaKeys> keys)
|
| +PassRefPtrWillBeRawPtr<MediaKeySession> MediaKeySession::create(ExecutionContext* context, blink::WebContentDecryptionModule* cdm, WeakPtr<MediaKeys> keys)
|
| {
|
| RefPtrWillBeRawPtr<MediaKeySession> session(adoptRefWillBeRefCountedGarbageCollected(new MediaKeySession(context, cdm, keys)));
|
| session->suspendIfNeeded();
|
| return session.release();
|
| }
|
|
|
| -MediaKeySession::MediaKeySession(ExecutionContext* context, ContentDecryptionModule* cdm, WeakPtr<MediaKeys> keys)
|
| +MediaKeySession::MediaKeySession(ExecutionContext* context, blink::WebContentDecryptionModule* cdm, WeakPtr<MediaKeys> keys)
|
| : ActiveDOMObject(context)
|
| , m_keySystem(keys->keySystem())
|
| , m_asyncEventQueue(GenericEventQueue::create(this))
|
| - , m_session(cdm->createSession(this))
|
| + , m_session(adoptPtr(cdm->createSession(this)))
|
| , m_keys(keys)
|
| , m_isClosed(false)
|
| , m_actionTimer(this, &MediaKeySession::actionTimerFired)
|
| @@ -98,7 +101,7 @@ String MediaKeySession::sessionId() const
|
| void MediaKeySession::initializeNewSession(const String& mimeType, const Uint8Array& initData)
|
| {
|
| ASSERT(!m_isClosed);
|
| - m_session->initializeNewSession(mimeType, initData);
|
| + m_session->initializeNewSession(mimeType, initData.data(), initData.length());
|
| }
|
|
|
| void MediaKeySession::update(Uint8Array* response, ExceptionState& exceptionState)
|
| @@ -158,7 +161,7 @@ void MediaKeySession::actionTimerFired(Timer<MediaKeySession>*)
|
| // 3.2. Let request be null.
|
| // 3.3. Use cdm to execute the following steps:
|
| // 3.3.1 Process response.
|
| - m_session->update(*(pendingAction->data));
|
| + m_session->update(pendingAction->data->data(), pendingAction->data->length());
|
| break;
|
| case PendingAction::Release:
|
| // NOTE: Continued from step 3. of MediaKeySession::release().
|
| @@ -172,7 +175,7 @@ void MediaKeySession::actionTimerFired(Timer<MediaKeySession>*)
|
| }
|
|
|
| // Queue a task to fire a simple event named keymessage at the new object
|
| -void MediaKeySession::message(const unsigned char* message, size_t messageLength, const KURL& destinationURL)
|
| +void MediaKeySession::message(const unsigned char* message, size_t messageLength, const blink::WebURL& destinationURL)
|
| {
|
| WTF_LOG(Media, "MediaKeySession::message");
|
|
|
| @@ -180,7 +183,7 @@ void MediaKeySession::message(const unsigned char* message, size_t messageLength
|
| init.bubbles = false;
|
| init.cancelable = false;
|
| init.message = Uint8Array::create(message, messageLength);
|
| - init.destinationURL = destinationURL;
|
| + init.destinationURL = destinationURL.string();
|
|
|
| RefPtr<MediaKeyMessageEvent> event = MediaKeyMessageEvent::create(EventTypeNames::message, init);
|
| event->setTarget(this);
|
| @@ -216,10 +219,10 @@ void MediaKeySession::error(MediaKeyErrorCode errorCode, unsigned long systemCod
|
|
|
| MediaKeyError::Code mediaKeyErrorCode = MediaKeyError::MEDIA_KEYERR_UNKNOWN;
|
| switch (errorCode) {
|
| - case UnknownError:
|
| + case MediaKeyErrorCodeUnknown:
|
| mediaKeyErrorCode = MediaKeyError::MEDIA_KEYERR_UNKNOWN;
|
| break;
|
| - case ClientError:
|
| + case MediaKeyErrorCodeClient:
|
| mediaKeyErrorCode = MediaKeyError::MEDIA_KEYERR_CLIENT;
|
| break;
|
| }
|
|
|