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

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

Issue 18398002: Remove IDBNotFoundError ExceptionCode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add missing include in code gen wich causes win compile failure Created 7 years, 5 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/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;
}

Powered by Google App Engine
This is Rietveld 408576698