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

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

Issue 1009503003: [bindings] Introduce ScriptValue.to<T> to convert to native values. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing 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/IDBFactory.cpp ('k') | Source/modules/indexeddb/IDBObjectStore.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/indexeddb/IDBKeyRange.cpp
diff --git a/Source/modules/indexeddb/IDBKeyRange.cpp b/Source/modules/indexeddb/IDBKeyRange.cpp
index 19b56ce448aca12111a457510291e4b7a9981197..1ad1cc6c88a5c061c44447e3474e7176c0b0d8cd 100644
--- a/Source/modules/indexeddb/IDBKeyRange.cpp
+++ b/Source/modules/indexeddb/IDBKeyRange.cpp
@@ -39,11 +39,11 @@ IDBKeyRange* IDBKeyRange::fromScriptValue(ExecutionContext* context, const Scrip
if (value.isUndefined() || value.isNull())
return 0;
- IDBKeyRange* range = scriptValueToIDBKeyRange(toIsolate(context), value);
+ IDBKeyRange* range = value.to<IDBKeyRange*>(exceptionState);
if (range)
return range;
- IDBKey* key = scriptValueToIDBKey(toIsolate(context), value);
+ IDBKey* key = value.to<IDBKey*>(exceptionState);
if (!key || !key->isValid()) {
exceptionState.throwDOMException(DataError, IDBDatabase::notValidKeyErrorMessage);
return 0;
@@ -88,7 +88,7 @@ IDBKeyRange* IDBKeyRange::only(IDBKey* key, ExceptionState& exceptionState)
IDBKeyRange* IDBKeyRange::only(ExecutionContext* context, const ScriptValue& keyValue, ExceptionState& exceptionState)
{
- IDBKey* key = scriptValueToIDBKey(toIsolate(context), keyValue);
+ IDBKey* key = keyValue.to<IDBKey*>(exceptionState);
if (!key || !key->isValid()) {
exceptionState.throwDOMException(DataError, IDBDatabase::notValidKeyErrorMessage);
return 0;
@@ -99,7 +99,7 @@ IDBKeyRange* IDBKeyRange::only(ExecutionContext* context, const ScriptValue& key
IDBKeyRange* IDBKeyRange::lowerBound(ExecutionContext* context, const ScriptValue& boundValue, bool open, ExceptionState& exceptionState)
{
- IDBKey* bound = scriptValueToIDBKey(toIsolate(context), boundValue);
+ IDBKey* bound = boundValue.to<IDBKey*>(exceptionState);
if (!bound || !bound->isValid()) {
exceptionState.throwDOMException(DataError, IDBDatabase::notValidKeyErrorMessage);
return 0;
@@ -110,7 +110,7 @@ IDBKeyRange* IDBKeyRange::lowerBound(ExecutionContext* context, const ScriptValu
IDBKeyRange* IDBKeyRange::upperBound(ExecutionContext* context, const ScriptValue& boundValue, bool open, ExceptionState& exceptionState)
{
- IDBKey* bound = scriptValueToIDBKey(toIsolate(context), boundValue);
+ IDBKey* bound = boundValue.to<IDBKey*>(exceptionState);
if (!bound || !bound->isValid()) {
exceptionState.throwDOMException(DataError, IDBDatabase::notValidKeyErrorMessage);
return 0;
@@ -121,8 +121,8 @@ IDBKeyRange* IDBKeyRange::upperBound(ExecutionContext* context, const ScriptValu
IDBKeyRange* IDBKeyRange::bound(ExecutionContext* context, const ScriptValue& lowerValue, const ScriptValue& upperValue, bool lowerOpen, bool upperOpen, ExceptionState& exceptionState)
{
- IDBKey* lower = scriptValueToIDBKey(toIsolate(context), lowerValue);
- IDBKey* upper = scriptValueToIDBKey(toIsolate(context), upperValue);
+ IDBKey* lower = lowerValue.to<IDBKey*>(exceptionState);
+ IDBKey* upper = upperValue.to<IDBKey*>(exceptionState);
if (!lower || !lower->isValid() || !upper || !upper->isValid()) {
exceptionState.throwDOMException(DataError, IDBDatabase::notValidKeyErrorMessage);
« no previous file with comments | « Source/modules/indexeddb/IDBFactory.cpp ('k') | Source/modules/indexeddb/IDBObjectStore.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698