Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2015)

Unified Diff: Source/modules/encryptedmedia/MediaKeySession.cpp

Issue 186093003: Remove platform/drm files. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: nits Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/encryptedmedia/MediaKeySession.h ('k') | Source/modules/encryptedmedia/MediaKeys.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « Source/modules/encryptedmedia/MediaKeySession.h ('k') | Source/modules/encryptedmedia/MediaKeys.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698