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

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

Issue 1158973007: IndexedDB: Rely on bindings for enum validation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 5 years, 7 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/modules/indexeddb/IDBCursor.cpp ('k') | Source/modules/indexeddb/IDBIndex.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/indexeddb/IDBDatabase.cpp
diff --git a/Source/modules/indexeddb/IDBDatabase.cpp b/Source/modules/indexeddb/IDBDatabase.cpp
index 33270b39a61ae2b6637264dcb07b59fb25a580e1..d365d959afae1069d25fc9ad5a2c98841e6b0420 100644
--- a/Source/modules/indexeddb/IDBDatabase.cpp
+++ b/Source/modules/indexeddb/IDBDatabase.cpp
@@ -289,7 +289,12 @@ IDBTransaction* IDBDatabase::transaction(ScriptState* scriptState, const StringO
return nullptr;
}
- WebIDBTransactionMode mode = IDBTransaction::stringToMode(modeString, exceptionState);
+ WebIDBTransactionMode mode = IDBTransaction::stringToMode(modeString);
+ if (mode != WebIDBTransactionModeReadOnly && mode != WebIDBTransactionModeReadWrite) {
+ exceptionState.throwTypeError("The mode provided ('" + modeString + "') is not one of 'readonly' or 'readwrite'.");
+ return nullptr;
+ }
+
if (exceptionState.hadException())
return nullptr;
« no previous file with comments | « Source/modules/indexeddb/IDBCursor.cpp ('k') | Source/modules/indexeddb/IDBIndex.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698