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

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

Issue 18398002: Remove IDBNotFoundError ExceptionCode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: merge Created 7 years, 6 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/IDBObjectStore.cpp
diff --git a/Source/modules/indexeddb/IDBObjectStore.cpp b/Source/modules/indexeddb/IDBObjectStore.cpp
index 1388897ee60f291ed1bfdb53015a33afbf5095e7..8b094e0f48a45fd42e809bfd20791e77b4361e42 100644
--- a/Source/modules/indexeddb/IDBObjectStore.cpp
+++ b/Source/modules/indexeddb/IDBObjectStore.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "modules/indexeddb/IDBObjectStore.h"
+#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/IDBBindingUtilities.h"
#include "bindings/v8/SerializedScriptValue.h"
#include "core/dom/DOMStringList.h"
@@ -418,15 +419,15 @@ PassRefPtr<IDBIndex> IDBObjectStore::createIndex(ScriptExecutionContext* context
return index.release();
}
-PassRefPtr<IDBIndex> IDBObjectStore::index(const String& name, ExceptionCode& ec)
+PassRefPtr<IDBIndex> IDBObjectStore::index(const String& name, ExceptionState& es)
{
IDB_TRACE("IDBObjectStore::index");
if (isDeleted()) {
- ec = INVALID_STATE_ERR;
+ es.throwDOMException(INVALID_STATE_ERR);
return 0;
}
if (m_transaction->isFinished()) {
- ec = INVALID_STATE_ERR;
+ es.throwDOMException(INVALID_STATE_ERR);
return 0;
}
@@ -436,8 +437,8 @@ PassRefPtr<IDBIndex> IDBObjectStore::index(const String& name, ExceptionCode& ec
int64_t indexId = findIndexId(name);
if (indexId == IDBIndexMetadata::InvalidId) {
- // FIXME: Should use (NotFoundError, "...").
- ec = IDBNotFoundError;
+ // FIXME: Should use constant
+ es.throwDOMException(NOT_FOUND_ERR, "An operation failed because the requested database object could not be found.");
return 0;
}
@@ -456,21 +457,21 @@ PassRefPtr<IDBIndex> IDBObjectStore::index(const String& name, ExceptionCode& ec
return index.release();
}
-void IDBObjectStore::deleteIndex(const String& name, ExceptionCode& ec)
+void IDBObjectStore::deleteIndex(const String& name, ExceptionState& es)
{
IDB_TRACE("IDBObjectStore::deleteIndex");
if (!m_transaction->isVersionChange() || isDeleted()) {
- ec = INVALID_STATE_ERR;
+ es.throwDOMException(INVALID_STATE_ERR);
return;
}
if (!m_transaction->isActive()) {
- ec = TransactionInactiveError;
+ es.throwDOMException(TransactionInactiveError);
return;
}
int64_t indexId = findIndexId(name);
if (indexId == IDBIndexMetadata::InvalidId) {
- // FIXME: Should use (NotFoundError, "...").
- ec = IDBNotFoundError;
+ // FIXME: Should use constant
+ es.throwDOMException(NOT_FOUND_ERR, "An operation failed because the requested database object could not be found.");
return;
}

Powered by Google App Engine
This is Rietveld 408576698