Index: Source/modules/indexeddb/IDBIndex.cpp |
diff --git a/Source/modules/indexeddb/IDBIndex.cpp b/Source/modules/indexeddb/IDBIndex.cpp |
index 316cc0c7013247da59cbe8f98e4aedd89763092c..5ae6d740500da03795761b78793f72c1f478cb1c 100644 |
--- a/Source/modules/indexeddb/IDBIndex.cpp |
+++ b/Source/modules/indexeddb/IDBIndex.cpp |
@@ -60,7 +60,11 @@ PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, Pas |
{ |
IDB_TRACE("IDBIndex::openCursor"); |
if (isDeleted()) { |
- es.throwDOMException(InvalidStateError); |
+ es.throwDOMException(InvalidStateError, IDBDatabase::indexDeletedErrorMessage); |
+ return 0; |
+ } |
+ if (m_transaction->isFinished()) { |
+ es.throwDOMException(TransactionInactiveError, IDBDatabase::transactionFinishedErrorMessage); |
return 0; |
} |
if (!m_transaction->isActive()) { |
@@ -90,7 +94,11 @@ PassRefPtr<IDBRequest> IDBIndex::count(ScriptExecutionContext* context, PassRefP |
{ |
IDB_TRACE("IDBIndex::count"); |
if (isDeleted()) { |
- es.throwDOMException(InvalidStateError); |
+ es.throwDOMException(InvalidStateError, IDBDatabase::indexDeletedErrorMessage); |
+ return 0; |
+ } |
+ if (m_transaction->isFinished()) { |
+ es.throwDOMException(TransactionInactiveError, IDBDatabase::transactionFinishedErrorMessage); |
return 0; |
} |
if (!m_transaction->isActive()) { |
@@ -115,7 +123,11 @@ PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context, |
{ |
IDB_TRACE("IDBIndex::openKeyCursor"); |
if (isDeleted()) { |
- es.throwDOMException(InvalidStateError); |
+ es.throwDOMException(InvalidStateError, IDBDatabase::indexDeletedErrorMessage); |
+ return 0; |
+ } |
+ if (m_transaction->isFinished()) { |
+ es.throwDOMException(TransactionInactiveError, IDBDatabase::transactionFinishedErrorMessage); |
return 0; |
} |
if (!m_transaction->isActive()) { |
@@ -154,7 +166,11 @@ PassRefPtr<IDBRequest> IDBIndex::get(ScriptExecutionContext* context, PassRefPtr |
{ |
IDB_TRACE("IDBIndex::get"); |
if (isDeleted()) { |
- es.throwDOMException(InvalidStateError); |
+ es.throwDOMException(InvalidStateError, IDBDatabase::indexDeletedErrorMessage); |
+ return 0; |
+ } |
+ if (m_transaction->isFinished()) { |
+ es.throwDOMException(TransactionInactiveError, IDBDatabase::transactionFinishedErrorMessage); |
return 0; |
} |
if (!m_transaction->isActive()) { |
@@ -162,7 +178,7 @@ PassRefPtr<IDBRequest> IDBIndex::get(ScriptExecutionContext* context, PassRefPtr |
return 0; |
} |
if (!keyRange) { |
- es.throwDOMException(DataError); |
+ es.throwDOMException(DataError, IDBDatabase::noKeyOrKeyRangeErrorMessage); |
return 0; |
} |
@@ -185,7 +201,11 @@ PassRefPtr<IDBRequest> IDBIndex::getKey(ScriptExecutionContext* context, PassRef |
{ |
IDB_TRACE("IDBIndex::getKey"); |
if (isDeleted()) { |
- es.throwDOMException(InvalidStateError); |
+ es.throwDOMException(InvalidStateError, IDBDatabase::indexDeletedErrorMessage); |
+ return 0; |
+ } |
+ if (m_transaction->isFinished()) { |
+ es.throwDOMException(TransactionInactiveError, IDBDatabase::transactionFinishedErrorMessage); |
return 0; |
} |
if (!m_transaction->isActive()) { |
@@ -193,7 +213,7 @@ PassRefPtr<IDBRequest> IDBIndex::getKey(ScriptExecutionContext* context, PassRef |
return 0; |
} |
if (!keyRange) { |
- es.throwDOMException(DataError); |
+ es.throwDOMException(DataError, IDBDatabase::noKeyOrKeyRangeErrorMessage); |
return 0; |
} |