| Index: third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
|
| diff --git a/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp b/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
|
| index a5cbf998856527f4776fd6d110fcb73c80637f94..6d73bc8dd3de2fbe46fd64f3cadeb87e88547433 100644
|
| --- a/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
|
| +++ b/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
|
| @@ -4,8 +4,10 @@
|
|
|
| #include "modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.h"
|
|
|
| +#include "bindings/core/v8/ScriptPromise.h"
|
| #include "bindings/core/v8/ScriptPromiseResolver.h"
|
| #include "bindings/core/v8/ScriptState.h"
|
| +#include "bindings/core/v8/V8Binding.h"
|
| #include "core/dom/DOMException.h"
|
| #include "core/dom/Document.h"
|
| #include "core/dom/ExceptionCode.h"
|
| @@ -254,19 +256,18 @@ ScriptPromise NavigatorRequestMediaKeySystemAccess::requestMediaKeySystemAccess(
|
|
|
| // From https://w3c.github.io/encrypted-media/#requestMediaKeySystemAccess
|
| // When this method is invoked, the user agent must run the following steps:
|
| - // 1. If keySystem is an empty string, return a promise rejected with a
|
| - // new DOMException whose name is InvalidAccessError.
|
| + // 1. If keySystem is the empty string, return a promise rejected with a
|
| + // newly created TypeError.
|
| if (keySystem.isEmpty()) {
|
| - return ScriptPromise::rejectWithDOMException(
|
| - scriptState, DOMException::create(InvalidAccessError, "The keySystem parameter is empty."));
|
| + return ScriptPromise::reject(
|
| + scriptState, v8::Exception::TypeError(v8String(scriptState->isolate(), "The keySystem parameter is empty.")));
|
| }
|
|
|
| - // 2. If supportedConfigurations was provided and is empty, return a
|
| - // promise rejected with a new DOMException whose name is
|
| - // InvalidAccessError.
|
| + // 2. If supportedConfigurations is empty, return a promise rejected with
|
| + // a newly created TypeError.
|
| if (!supportedConfigurations.size()) {
|
| - return ScriptPromise::rejectWithDOMException(
|
| - scriptState, DOMException::create(InvalidAccessError, "The supportedConfigurations parameter is empty."));
|
| + return ScriptPromise::reject(
|
| + scriptState, v8::Exception::TypeError(v8String(scriptState->isolate(), "The supportedConfigurations parameter is empty.")));
|
| }
|
|
|
| // 3-4. 'May Document use powerful features?' check.
|
|
|