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

Unified Diff: third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp

Issue 2342953002: Update EME errors to use TypeError (Closed)
Patch Set: changes Created 4 years, 2 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
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 510e1dcba24cd39c0dc0b83b80c60cbe4473ed59..360f28c0767652954f0e92d1bdd5810b89844fab 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/V8ThrowException.h"
#include "core/dom/DOMException.h"
#include "core/dom/Document.h"
#include "core/dom/ExceptionCode.h"
@@ -312,21 +314,21 @@ 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,
+ return ScriptPromise::reject(
+ scriptState,
+ V8ThrowException::createTypeError(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,
+ return ScriptPromise::reject(
+ scriptState, V8ThrowException::createTypeError(
+ scriptState->isolate(),
"The supportedConfigurations parameter is empty."));
}

Powered by Google App Engine
This is Rietveld 408576698