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

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

Issue 1021713003: [bindings] Let NativeValueTraits<T>::nativeValue be variadic function and merge various convers… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: IDB related changes alone. Created 5 years, 9 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/IDBKeyRange.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/IDBObjectStore.cpp
diff --git a/Source/modules/indexeddb/IDBObjectStore.cpp b/Source/modules/indexeddb/IDBObjectStore.cpp
index fb4b868552042d43f96a8b856443fc32d8d87a47..509f253748c7cd3aebee92139a9fe627c43ce26a 100644
--- a/Source/modules/indexeddb/IDBObjectStore.cpp
+++ b/Source/modules/indexeddb/IDBObjectStore.cpp
@@ -121,7 +121,8 @@ IDBRequest* IDBObjectStore::get(ScriptState* scriptState, const ScriptValue& key
static void generateIndexKeysForValue(v8::Isolate* isolate, const IDBIndexMetadata& indexMetadata, const ScriptValue& objectValue, IDBObjectStore::IndexKeys* indexKeys)
{
ASSERT(indexKeys);
- IDBKey* indexKey = createIDBKeyFromScriptValueAndKeyPath(isolate, objectValue, indexMetadata.keyPath);
+ NonThrowableExceptionState exceptionState;
+ IDBKey* indexKey = ScriptValue::to<IDBKey*>(isolate, objectValue, exceptionState, indexMetadata.keyPath);
if (!indexKey)
return;
@@ -155,7 +156,7 @@ IDBRequest* IDBObjectStore::put(ScriptState* scriptState, const ScriptValue& val
IDBRequest* IDBObjectStore::put(ScriptState* scriptState, WebIDBPutMode putMode, IDBAny* source, const ScriptValue& value, const ScriptValue& keyValue, ExceptionState& exceptionState)
{
- IDBKey* key = keyValue.isUndefined() ? nullptr : keyValue.to<IDBKey*>(exceptionState);
+ IDBKey* key = keyValue.isUndefined() ? nullptr : ScriptValue::to<IDBKey*>(scriptState->isolate(), keyValue, exceptionState);
return put(scriptState, putMode, source, value, key, exceptionState);
}
@@ -202,7 +203,7 @@ IDBRequest* IDBObjectStore::put(ScriptState* scriptState, WebIDBPutMode putMode,
ASSERT(key);
if (clone.isEmpty())
clone = deserializeScriptValue(scriptState, serializedValue.get(), &blobInfo);
- IDBKey* keyPathKey = createIDBKeyFromScriptValueAndKeyPath(scriptState->isolate(), clone, keyPath);
+ IDBKey* keyPathKey = ScriptValue::to<IDBKey*>(scriptState->isolate(), clone, exceptionState, keyPath);
if (!keyPathKey || !keyPathKey->isEqual(key)) {
exceptionState.throwDOMException(DataError, "The effective object store of this cursor uses in-line keys and evaluating the key path of the value parameter results in a different value than the cursor's effective key.");
return nullptr;
@@ -216,7 +217,7 @@ IDBRequest* IDBObjectStore::put(ScriptState* scriptState, WebIDBPutMode putMode,
if (usesInLineKeys) {
if (clone.isEmpty())
clone = deserializeScriptValue(scriptState, serializedValue.get(), &blobInfo);
- IDBKey* keyPathKey = createIDBKeyFromScriptValueAndKeyPath(scriptState->isolate(), clone, keyPath);
+ IDBKey* keyPathKey = ScriptValue::to<IDBKey*>(scriptState->isolate(), clone, exceptionState, keyPath);
if (keyPathKey && !keyPathKey->isValid()) {
exceptionState.throwDOMException(DataError, "Evaluating the object store's key path yielded a value that is not a valid key.");
return 0;
« no previous file with comments | « Source/modules/indexeddb/IDBKeyRange.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698