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

Unified Diff: Source/modules/indexeddb/IDBCursor.cpp

Issue 121113004: Improve handling of failed integer type conversions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 11 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
« no previous file with comments | « Source/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/indexeddb/IDBCursor.cpp
diff --git a/Source/modules/indexeddb/IDBCursor.cpp b/Source/modules/indexeddb/IDBCursor.cpp
index 8ea735858c5ba2e5254bbb7ca3ec2074d93d6faa..ed68e84584ce7cb5e220a845a730adf99e6927d3 100644
--- a/Source/modules/indexeddb/IDBCursor.cpp
+++ b/Source/modules/indexeddb/IDBCursor.cpp
@@ -142,6 +142,10 @@ PassRefPtr<IDBRequest> IDBCursor::update(ScriptState* state, ScriptValue& value,
void IDBCursor::advance(unsigned long count, ExceptionState& exceptionState)
{
IDB_TRACE("IDBCursor::advance");
+ if (!count) {
+ exceptionState.throwTypeError("A count argument with value 0 (zero) was supplied, must be greater than 0.");
+ return;
+ }
if (!m_gotValue) {
exceptionState.throwDOMException(InvalidStateError, IDBDatabase::noValueErrorMessage);
return;
@@ -160,11 +164,6 @@ void IDBCursor::advance(unsigned long count, ExceptionState& exceptionState)
return;
}
- if (!count) {
- exceptionState.throwUninformativeAndGenericTypeError();
- return;
- }
-
m_request->setPendingCursor(this);
m_gotValue = false;
m_backend->advance(count, WebIDBCallbacksImpl::create(m_request).leakPtr());
« no previous file with comments | « Source/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698