| Index: Source/modules/encryptedmedia/MediaKeys.cpp
|
| diff --git a/Source/modules/encryptedmedia/MediaKeys.cpp b/Source/modules/encryptedmedia/MediaKeys.cpp
|
| index 540b972606fe7c03e256b17006dae701231ee1dd..fea8256395a535b258bb67eff6ea9bfbe900c3e0 100644
|
| --- a/Source/modules/encryptedmedia/MediaKeys.cpp
|
| +++ b/Source/modules/encryptedmedia/MediaKeys.cpp
|
| @@ -26,7 +26,6 @@
|
| #include "config.h"
|
| #include "modules/encryptedmedia/MediaKeys.h"
|
|
|
| -#include "bindings/v8/ExceptionState.h"
|
| #include "core/dom/EventNames.h"
|
| #include "core/html/HTMLMediaElement.h"
|
| #include "core/platform/UUID.h"
|
| @@ -37,20 +36,20 @@
|
|
|
| namespace WebCore {
|
|
|
| -PassRefPtr<MediaKeys> MediaKeys::create(const String& keySystem, ExceptionState& es)
|
| +PassRefPtr<MediaKeys> MediaKeys::create(const String& keySystem, ExceptionCode& ec)
|
| {
|
| // From <http://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/encrypted-media.html#dom-media-keys-constructor>:
|
| // The MediaKeys(keySystem) constructor must run the following steps:
|
|
|
| // 1. If keySystem is null or an empty string, throw an InvalidAccessError exception and abort these steps.
|
| if (keySystem.isEmpty()) {
|
| - es.throwDOMException(InvalidAccessError);
|
| + ec = InvalidAccessError;
|
| return 0;
|
| }
|
|
|
| // 2. If keySystem is not one of the user agent's supported Key Systems, throw a NotSupportedError and abort these steps.
|
| if (!ContentDecryptionModule::supportsKeySystem(keySystem)) {
|
| - es.throwDOMException(NotSupportedError);
|
| + ec = NotSupportedError;
|
| return 0;
|
| }
|
|
|
| @@ -58,7 +57,7 @@ PassRefPtr<MediaKeys> MediaKeys::create(const String& keySystem, ExceptionState&
|
| // 4. Load cdm if necessary.
|
| OwnPtr<ContentDecryptionModule> cdm = ContentDecryptionModule::create(keySystem);
|
| if (!cdm) {
|
| - es.throwDOMException(NotSupportedError);
|
| + ec = NotSupportedError;
|
| return 0;
|
| }
|
|
|
| @@ -84,7 +83,7 @@ MediaKeys::~MediaKeys()
|
| m_sessions[i]->close();
|
| }
|
|
|
| -PassRefPtr<MediaKeySession> MediaKeys::createSession(ScriptExecutionContext* context, const String& type, Uint8Array* initData, ExceptionState& es)
|
| +PassRefPtr<MediaKeySession> MediaKeys::createSession(ScriptExecutionContext* context, const String& type, Uint8Array* initData, ExceptionCode& ec)
|
| {
|
| // From <http://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/encrypted-media.html#dom-createsession>:
|
| // The createSession(type, initData) method must run the following steps:
|
| @@ -93,7 +92,7 @@ PassRefPtr<MediaKeySession> MediaKeys::createSession(ScriptExecutionContext* con
|
| // 1. If type is null or an empty string and initData is not null or an empty string, throw an
|
| // InvalidAccessError exception and abort these steps.
|
| if ((type.isEmpty()) && (!initData || initData->length())) {
|
| - es.throwDOMException(InvalidAccessError);
|
| + ec = InvalidAccessError;
|
| return 0;
|
| }
|
|
|
| @@ -101,7 +100,7 @@ PassRefPtr<MediaKeySession> MediaKeys::createSession(ScriptExecutionContext* con
|
| // a NotSupportedError exception and abort these steps.
|
| ASSERT(!type.isEmpty());
|
| if (type.isEmpty() || !m_cdm->supportsMIMEType(type)) {
|
| - es.throwDOMException(NotSupportedError);
|
| + ec = NotSupportedError;
|
| return 0;
|
| }
|
|
|
|
|