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

Side by Side Diff: Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp

Issue 235123002: Should throw TypeError instead of TypeMismatchError (modules) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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 unified diff | Download patch
« no previous file with comments | « Source/modules/crypto/Crypto.cpp ('k') | Source/modules/filesystem/FileWriterSync.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h" 6 #include "modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h"
7 7
8 #include "RuntimeEnabledFeatures.h" 8 #include "RuntimeEnabledFeatures.h"
9 #include "bindings/v8/ExceptionState.h" 9 #include "bindings/v8/ExceptionState.h"
10 #include "core/dom/ExceptionCode.h" 10 #include "core/dom/ExceptionCode.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 exceptionState.throwDOMException(SyntaxError, "The key system provided i s empty."); 190 exceptionState.throwDOMException(SyntaxError, "The key system provided i s empty.");
191 return; 191 return;
192 } 192 }
193 193
194 if (!key) { 194 if (!key) {
195 exceptionState.throwDOMException(SyntaxError, "The key provided is inval id."); 195 exceptionState.throwDOMException(SyntaxError, "The key provided is inval id.");
196 return; 196 return;
197 } 197 }
198 198
199 if (!key->length()) { 199 if (!key->length()) {
200 exceptionState.throwDOMException(TypeMismatchError, "The key provided is invalid."); 200 exceptionState.throwDOMException(TypeError, "The key provided is invalid .");
201 return; 201 return;
202 } 202 }
203 203
204 if (!webMediaPlayer) { 204 if (!webMediaPlayer) {
205 exceptionState.throwDOMException(InvalidStateError, "No media has been l oaded."); 205 exceptionState.throwDOMException(InvalidStateError, "No media has been l oaded.");
206 return; 206 return;
207 } 207 }
208 208
209 const unsigned char* initDataPointer = 0; 209 const unsigned char* initDataPointer = 0;
210 unsigned initDataLength = 0; 210 unsigned initDataLength = 0;
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 thisElement.setMediaKeysInternal(element, 0); 344 thisElement.setMediaKeysInternal(element, 0);
345 } 345 }
346 346
347 blink::WebContentDecryptionModule* HTMLMediaElementEncryptedMedia::contentDecryp tionModule(HTMLMediaElement& element) 347 blink::WebContentDecryptionModule* HTMLMediaElementEncryptedMedia::contentDecryp tionModule(HTMLMediaElement& element)
348 { 348 {
349 HTMLMediaElementEncryptedMedia& thisElement = HTMLMediaElementEncryptedMedia ::from(element); 349 HTMLMediaElementEncryptedMedia& thisElement = HTMLMediaElementEncryptedMedia ::from(element);
350 return thisElement.contentDecryptionModule(); 350 return thisElement.contentDecryptionModule();
351 } 351 }
352 352
353 } // namespace WebCore 353 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/crypto/Crypto.cpp ('k') | Source/modules/filesystem/FileWriterSync.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698