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

Unified Diff: Source/modules/indexeddb/IDBKeyRange.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/IDBKeyRange.cpp
diff --git a/Source/modules/indexeddb/IDBKeyRange.cpp b/Source/modules/indexeddb/IDBKeyRange.cpp
index 3e6a84cbaee994aa0a0f7f8eb1f939ecdae31913..e01303db88d66731fa17ff0e1faab117167ac973 100644
--- a/Source/modules/indexeddb/IDBKeyRange.cpp
+++ b/Source/modules/indexeddb/IDBKeyRange.cpp
@@ -27,6 +27,7 @@
#include "modules/indexeddb/IDBKeyRange.h"
#include "bindings/v8/DOMRequestState.h"
+#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/IDBBindingUtilities.h"
#include "core/dom/ExceptionCode.h"
#include "modules/indexeddb/IDBKey.h"
@@ -60,69 +61,69 @@ ScriptValue IDBKeyRange::upperValue(ScriptExecutionContext* context) const
return idbKeyToScriptValue(&requestState, m_upper);
}
-PassRefPtr<IDBKeyRange> IDBKeyRange::only(PassRefPtr<IDBKey> prpKey, ExceptionCode& ec)
+PassRefPtr<IDBKeyRange> IDBKeyRange::only(PassRefPtr<IDBKey> prpKey, ExceptionState& es)
{
RefPtr<IDBKey> key = prpKey;
if (!key || !key->isValid()) {
- ec = DataError;
+ es.throwDOMException(DataError);
return 0;
}
return IDBKeyRange::create(key, key, LowerBoundClosed, UpperBoundClosed);
}
-PassRefPtr<IDBKeyRange> IDBKeyRange::only(ScriptExecutionContext* context, const ScriptValue& keyValue, ExceptionCode& ec)
+PassRefPtr<IDBKeyRange> IDBKeyRange::only(ScriptExecutionContext* context, const ScriptValue& keyValue, ExceptionState& es)
{
DOMRequestState requestState(context);
RefPtr<IDBKey> key = scriptValueToIDBKey(&requestState, keyValue);
if (!key || !key->isValid()) {
- ec = DataError;
+ es.throwDOMException(DataError);
return 0;
}
return IDBKeyRange::create(key, key, LowerBoundClosed, UpperBoundClosed);
}
-PassRefPtr<IDBKeyRange> IDBKeyRange::lowerBound(ScriptExecutionContext* context, const ScriptValue& boundValue, bool open, ExceptionCode& ec)
+PassRefPtr<IDBKeyRange> IDBKeyRange::lowerBound(ScriptExecutionContext* context, const ScriptValue& boundValue, bool open, ExceptionState& es)
{
DOMRequestState requestState(context);
RefPtr<IDBKey> bound = scriptValueToIDBKey(&requestState, boundValue);
if (!bound || !bound->isValid()) {
- ec = DataError;
+ es.throwDOMException(DataError);
return 0;
}
return IDBKeyRange::create(bound, 0, open ? LowerBoundOpen : LowerBoundClosed, UpperBoundOpen);
}
-PassRefPtr<IDBKeyRange> IDBKeyRange::upperBound(ScriptExecutionContext* context, const ScriptValue& boundValue, bool open, ExceptionCode& ec)
+PassRefPtr<IDBKeyRange> IDBKeyRange::upperBound(ScriptExecutionContext* context, const ScriptValue& boundValue, bool open, ExceptionState& es)
{
DOMRequestState requestState(context);
RefPtr<IDBKey> bound = scriptValueToIDBKey(&requestState, boundValue);
if (!bound || !bound->isValid()) {
- ec = DataError;
+ es.throwDOMException(DataError);
return 0;
}
return IDBKeyRange::create(0, bound, LowerBoundOpen, open ? UpperBoundOpen : UpperBoundClosed);
}
-PassRefPtr<IDBKeyRange> IDBKeyRange::bound(ScriptExecutionContext* context, const ScriptValue& lowerValue, const ScriptValue& upperValue, bool lowerOpen, bool upperOpen, ExceptionCode& ec)
+PassRefPtr<IDBKeyRange> IDBKeyRange::bound(ScriptExecutionContext* context, const ScriptValue& lowerValue, const ScriptValue& upperValue, bool lowerOpen, bool upperOpen, ExceptionState& es)
{
DOMRequestState requestState(context);
RefPtr<IDBKey> lower = scriptValueToIDBKey(&requestState, lowerValue);
RefPtr<IDBKey> upper = scriptValueToIDBKey(&requestState, upperValue);
if (!lower || !lower->isValid() || !upper || !upper->isValid()) {
- ec = DataError;
+ es.throwDOMException(DataError);
return 0;
}
if (upper->isLessThan(lower.get())) {
- ec = DataError;
+ es.throwDOMException(DataError);
return 0;
}
if (upper->isEqual(lower.get()) && (lowerOpen || upperOpen)) {
- ec = DataError;
+ es.throwDOMException(DataError);
return 0;
}

Powered by Google App Engine
This is Rietveld 408576698