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

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: Minimize diff 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
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) {
jsbell 2015/06/02 19:01:07 Written this way instead of (mode == WebIDBTransac
+ exceptionState.throwTypeError("The mode provided ('" + modeString + "') is not one of 'readonly' or 'readwrite'.");
jsbell 2015/06/02 19:01:07 And similarly, this could be changed to e.g. "You
+ return nullptr;
+ }
+
if (exceptionState.hadException())
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698