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

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

Issue 2342953002: Update EME errors to use TypeError (Closed)
Patch Set: Created 4 years, 3 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/HTMLMediaElementEncryptedMedia.cpp
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp b/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp
index 67ddefcc2ce88b3337d2c891e33e5aed2c5baa82..2f416e493a790d326d1653e2d2d8ccfd96290e79 100644
--- a/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp
+++ b/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp
@@ -57,7 +57,7 @@ typedef Function<void()> SuccessCallback;
typedef Function<void(ExceptionCode, const String&)> FailureCallback;
// Represents the result used when setContentDecryptionModule() is called.
-// Calls |success| if result is resolved, |failure| is result is rejected.
+// Calls |success| if result is resolved, |failure| if result is rejected.
class SetContentDecryptionModuleResult final : public ContentDecryptionModuleResult {
public:
SetContentDecryptionModuleResult(std::unique_ptr<SuccessCallback> success, std::unique_ptr<FailureCallback> failure)
@@ -97,6 +97,13 @@ public:
result.appendNumber(systemCode);
result.append(')');
}
+
+ // WebContentDecryptionModuleExceptionTypeError should be reported as
+ // a TypeError, not a DOMException. However, there is no need for a
+ // TypeError when setting/clearing the CDM, so verify that it never
+ // happens.
+ DCHECK_NE(WebContentDecryptionModuleExceptionTypeError, code);
ddorwin 2016/09/15 22:43:03 What would happen if we received this? Would the c
jrummell 2016/09/16 23:23:34 Removed now that haraken@ pointed out a better way
+
(*m_failureCallback)(WebCdmExceptionToExceptionCode(code), result.toString());
}

Powered by Google App Engine
This is Rietveld 408576698