| Index: Source/modules/indexeddb/IDBIndex.cpp
|
| diff --git a/Source/modules/indexeddb/IDBIndex.cpp b/Source/modules/indexeddb/IDBIndex.cpp
|
| index 0a7c9eba73192a28b94df8c64da51144118b020c..316cc0c7013247da59cbe8f98e4aedd89763092c 100644
|
| --- a/Source/modules/indexeddb/IDBIndex.cpp
|
| +++ b/Source/modules/indexeddb/IDBIndex.cpp
|
| @@ -26,6 +26,7 @@
|
| #include "config.h"
|
| #include "modules/indexeddb/IDBIndex.h"
|
|
|
| +#include "bindings/v8/ExceptionState.h"
|
| #include "core/dom/ExceptionCode.h"
|
| #include "core/dom/ScriptExecutionContext.h"
|
| #include "modules/indexeddb/IDBKey.h"
|
| @@ -55,19 +56,19 @@ IDBIndex::~IDBIndex()
|
| {
|
| }
|
|
|
| -PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, const String& directionString, ExceptionCode& ec)
|
| +PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, const String& directionString, ExceptionState& es)
|
| {
|
| IDB_TRACE("IDBIndex::openCursor");
|
| if (isDeleted()) {
|
| - ec = InvalidStateError;
|
| + es.throwDOMException(InvalidStateError);
|
| return 0;
|
| }
|
| if (!m_transaction->isActive()) {
|
| - ec = TransactionInactiveError;
|
| + es.throwDOMException(TransactionInactiveError);
|
| return 0;
|
| }
|
| - IndexedDB::CursorDirection direction = IDBCursor::stringToDirection(directionString, ec);
|
| - if (ec)
|
| + IndexedDB::CursorDirection direction = IDBCursor::stringToDirection(directionString, es);
|
| + if (es.hadException())
|
| return 0;
|
|
|
| RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
|
| @@ -76,24 +77,24 @@ PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, Pas
|
| return request;
|
| }
|
|
|
| -PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, const ScriptValue& key, const String& direction, ExceptionCode& ec)
|
| +PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, const ScriptValue& key, const String& direction, ExceptionState& es)
|
| {
|
| IDB_TRACE("IDBIndex::openCursor");
|
| - RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
|
| - if (ec)
|
| + RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, es);
|
| + if (es.hadException())
|
| return 0;
|
| - return openCursor(context, keyRange.release(), direction, ec);
|
| + return openCursor(context, keyRange.release(), direction, es);
|
| }
|
|
|
| -PassRefPtr<IDBRequest> IDBIndex::count(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec)
|
| +PassRefPtr<IDBRequest> IDBIndex::count(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionState& es)
|
| {
|
| IDB_TRACE("IDBIndex::count");
|
| if (isDeleted()) {
|
| - ec = InvalidStateError;
|
| + es.throwDOMException(InvalidStateError);
|
| return 0;
|
| }
|
| if (!m_transaction->isActive()) {
|
| - ec = TransactionInactiveError;
|
| + es.throwDOMException(TransactionInactiveError);
|
| return 0;
|
| }
|
| RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
|
| @@ -101,28 +102,28 @@ PassRefPtr<IDBRequest> IDBIndex::count(ScriptExecutionContext* context, PassRefP
|
| return request;
|
| }
|
|
|
| -PassRefPtr<IDBRequest> IDBIndex::count(ScriptExecutionContext* context, const ScriptValue& key, ExceptionCode& ec)
|
| +PassRefPtr<IDBRequest> IDBIndex::count(ScriptExecutionContext* context, const ScriptValue& key, ExceptionState& es)
|
| {
|
| IDB_TRACE("IDBIndex::count");
|
| - RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
|
| - if (ec)
|
| + RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, es);
|
| + if (es.hadException())
|
| return 0;
|
| - return count(context, keyRange.release(), ec);
|
| + return count(context, keyRange.release(), es);
|
| }
|
|
|
| -PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, const String& directionString, ExceptionCode& ec)
|
| +PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, const String& directionString, ExceptionState& es)
|
| {
|
| IDB_TRACE("IDBIndex::openKeyCursor");
|
| if (isDeleted()) {
|
| - ec = InvalidStateError;
|
| + es.throwDOMException(InvalidStateError);
|
| return 0;
|
| }
|
| if (!m_transaction->isActive()) {
|
| - ec = TransactionInactiveError;
|
| + es.throwDOMException(TransactionInactiveError);
|
| return 0;
|
| }
|
| - IndexedDB::CursorDirection direction = IDBCursor::stringToDirection(directionString, ec);
|
| - if (ec)
|
| + IndexedDB::CursorDirection direction = IDBCursor::stringToDirection(directionString, es);
|
| + if (es.hadException())
|
| return 0;
|
|
|
| RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
|
| @@ -131,37 +132,37 @@ PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context,
|
| return request;
|
| }
|
|
|
| -PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context, const ScriptValue& key, const String& direction, ExceptionCode& ec)
|
| +PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context, const ScriptValue& key, const String& direction, ExceptionState& es)
|
| {
|
| IDB_TRACE("IDBIndex::openKeyCursor");
|
| - RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
|
| - if (ec)
|
| + RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, es);
|
| + if (es.hadException())
|
| return 0;
|
| - return openKeyCursor(context, keyRange.release(), direction, ec);
|
| + return openKeyCursor(context, keyRange.release(), direction, es);
|
| }
|
|
|
| -PassRefPtr<IDBRequest> IDBIndex::get(ScriptExecutionContext* context, const ScriptValue& key, ExceptionCode& ec)
|
| +PassRefPtr<IDBRequest> IDBIndex::get(ScriptExecutionContext* context, const ScriptValue& key, ExceptionState& es)
|
| {
|
| IDB_TRACE("IDBIndex::get");
|
| - RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
|
| - if (ec)
|
| + RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, es);
|
| + if (es.hadException())
|
| return 0;
|
| - return get(context, keyRange.release(), ec);
|
| + return get(context, keyRange.release(), es);
|
| }
|
|
|
| -PassRefPtr<IDBRequest> IDBIndex::get(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec)
|
| +PassRefPtr<IDBRequest> IDBIndex::get(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionState& es)
|
| {
|
| IDB_TRACE("IDBIndex::get");
|
| if (isDeleted()) {
|
| - ec = InvalidStateError;
|
| + es.throwDOMException(InvalidStateError);
|
| return 0;
|
| }
|
| if (!m_transaction->isActive()) {
|
| - ec = TransactionInactiveError;
|
| + es.throwDOMException(TransactionInactiveError);
|
| return 0;
|
| }
|
| if (!keyRange) {
|
| - ec = DataError;
|
| + es.throwDOMException(DataError);
|
| return 0;
|
| }
|
|
|
| @@ -170,29 +171,29 @@ PassRefPtr<IDBRequest> IDBIndex::get(ScriptExecutionContext* context, PassRefPtr
|
| return request;
|
| }
|
|
|
| -PassRefPtr<IDBRequest> IDBIndex::getKey(ScriptExecutionContext* context, const ScriptValue& key, ExceptionCode& ec)
|
| +PassRefPtr<IDBRequest> IDBIndex::getKey(ScriptExecutionContext* context, const ScriptValue& key, ExceptionState& es)
|
| {
|
| IDB_TRACE("IDBIndex::getKey");
|
| - RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
|
| - if (ec)
|
| + RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, es);
|
| + if (es.hadException())
|
| return 0;
|
|
|
| - return getKey(context, keyRange.release(), ec);
|
| + return getKey(context, keyRange.release(), es);
|
| }
|
|
|
| -PassRefPtr<IDBRequest> IDBIndex::getKey(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec)
|
| +PassRefPtr<IDBRequest> IDBIndex::getKey(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionState& es)
|
| {
|
| IDB_TRACE("IDBIndex::getKey");
|
| if (isDeleted()) {
|
| - ec = InvalidStateError;
|
| + es.throwDOMException(InvalidStateError);
|
| return 0;
|
| }
|
| if (!m_transaction->isActive()) {
|
| - ec = TransactionInactiveError;
|
| + es.throwDOMException(TransactionInactiveError);
|
| return 0;
|
| }
|
| if (!keyRange) {
|
| - ec = DataError;
|
| + es.throwDOMException(DataError);
|
| return 0;
|
| }
|
|
|
|
|