Chromium Code Reviews| Index: third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp |
| diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp |
| index 32922bce07c2991fcea8563859e3b969212a24c4..c057c7f188cc3cd48108dc48746029d331693f38 100644 |
| --- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp |
| +++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp |
| @@ -25,7 +25,9 @@ |
| #include "modules/encryptedmedia/MediaKeys.h" |
| +#include "bindings/core/v8/ScriptPromise.h" |
| #include "bindings/core/v8/ScriptState.h" |
| +#include "bindings/core/v8/V8Binding.h" |
| #include "core/dom/DOMArrayBuffer.h" |
| #include "core/dom/DOMException.h" |
| #include "core/dom/ExceptionCode.h" |
| @@ -174,18 +176,18 @@ ScriptPromise MediaKeys::setServerCertificate(ScriptState* scriptState, const DO |
| // The setServerCertificate(serverCertificate) method provides a server |
| // certificate to be used to encrypt messages to the license server. |
| // It must run the following steps: |
| - // 1. If serverCertificate is an empty array, return a promise rejected |
| - // with a new DOMException whose name is "InvalidAccessError". |
| + // 1. If the Key System implementation represented by this object's cdm |
| + // implementation value does not support server certificates, return |
| + // a promise resolved with false. |
| + // (Let the CDM decide whether to support this or not.) |
|
ddorwin
2016/09/15 22:43:03
This is not spec compliant. The purpose of the spe
jrummell
2016/09/16 23:23:34
Replaced it with a TODO since it's currently not d
|
| + // |
| + // 2. If serverCertificate is an empty array, return a promise rejected |
| + // with a new a newly created TypeError. |
| if (!serverCertificate.byteLength()) { |
| - return ScriptPromise::rejectWithDOMException( |
| - scriptState, DOMException::create(InvalidAccessError, "The serverCertificate parameter is empty.")); |
| + return ScriptPromise::reject( |
| + scriptState, v8::Exception::TypeError(v8String(scriptState->isolate(), "The serverCertificate parameter is empty."))); |
| } |
| - // 2. If the keySystem does not support server certificates, return a |
| - // promise rejected with a new DOMException whose name is |
| - // "NotSupportedError". |
| - // (Let the CDM decide whether to support this or not.) |
| - |
| // 3. Let certificate be a copy of the contents of the serverCertificate |
| // parameter. |
| DOMArrayBuffer* serverCertificateBuffer = DOMArrayBuffer::create(serverCertificate.data(), serverCertificate.byteLength()); |