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

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

Issue 1188343002: IndexedDB: Disallow continuePrimaryKey on unique cursors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make assertion message more specific Created 5 years, 6 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 | « LayoutTests/storage/indexeddb/idbcursor_continueprimarykey.html ('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 ee01c33919af9c62a53dcc792d33666a884d6d9e..37e0dcfca46b266f73bdce067a81298bd9ec2391 100644
--- a/Source/modules/indexeddb/IDBCursor.cpp
+++ b/Source/modules/indexeddb/IDBCursor.cpp
@@ -166,6 +166,10 @@ void IDBCursor::continuePrimaryKey(ScriptState* scriptState, const ScriptValue&
exceptionState.throwDOMException(InvalidAccessError, "The cursor's source is not an index.");
return;
}
+ if (m_direction != WebIDBCursorDirectionNext && m_direction != WebIDBCursorDirectionPrev) {
+ exceptionState.throwDOMException(InvalidAccessError, "The cursor's direction is not 'next' or 'prev'.");
+ return;
+ }
IDBKey* key = ScriptValue::to<IDBKey*>(scriptState->isolate(), keyValue, exceptionState);
if (exceptionState.hadException())
« no previous file with comments | « LayoutTests/storage/indexeddb/idbcursor_continueprimarykey.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698