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

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

Issue 236773003: Completely remove DOMRequestState from IndexedDB code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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
« no previous file with comments | « Source/modules/indexeddb/IDBCursor.h ('k') | Source/modules/indexeddb/IDBFactory.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/indexeddb/IDBCursor.cpp
diff --git a/Source/modules/indexeddb/IDBCursor.cpp b/Source/modules/indexeddb/IDBCursor.cpp
index faf8d1b908d7b2720a8469cd5d8593ed9c1ff217..1b8a2a486b4f557450a3c23b0b8af0b1f0e96ae2 100644
--- a/Source/modules/indexeddb/IDBCursor.cpp
+++ b/Source/modules/indexeddb/IDBCursor.cpp
@@ -28,6 +28,7 @@
#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/IDBBindingUtilities.h"
+#include "bindings/v8/ScriptState.h"
#include "core/dom/ExceptionCode.h"
#include "core/dom/ExecutionContext.h"
#include "core/inspector/ScriptCallStack.h"
@@ -130,7 +131,7 @@ PassRefPtr<IDBRequest> IDBCursor::update(ScriptState* state, ScriptValue& value,
const IDBKeyPath& keyPath = objectStore->metadata().keyPath;
const bool usesInLineKeys = !keyPath.isNull();
if (usesInLineKeys) {
- RefPtr<IDBKey> keyPathKey = createIDBKeyFromScriptValueAndKeyPath(m_request->requestState(), value, keyPath);
+ RefPtr<IDBKey> keyPathKey = createIDBKeyFromScriptValueAndKeyPath(state->isolate(), value, keyPath);
if (!keyPathKey || !keyPathKey->isEqual(m_primaryKey.get())) {
exceptionState.throwDOMException(DataError, "The effective object store of this cursor uses in-line keys and evaluating the key path of the value parameter results in a different value than the cursor's effective key.");
return nullptr;
@@ -173,8 +174,7 @@ void IDBCursor::advance(unsigned long count, ExceptionState& exceptionState)
void IDBCursor::continueFunction(ExecutionContext* context, const ScriptValue& keyValue, ExceptionState& exceptionState)
{
IDB_TRACE("IDBCursor::continue");
- DOMRequestState requestState(toIsolate(context));
- RefPtr<IDBKey> key = keyValue.isUndefined() || keyValue.isNull() ? nullptr : scriptValueToIDBKey(&requestState, keyValue);
+ RefPtr<IDBKey> key = keyValue.isUndefined() || keyValue.isNull() ? nullptr : scriptValueToIDBKey(toIsolate(context), keyValue);
if (key && !key->isValid()) {
exceptionState.throwDOMException(DataError, IDBDatabase::notValidKeyErrorMessage);
return;
@@ -185,9 +185,8 @@ void IDBCursor::continueFunction(ExecutionContext* context, const ScriptValue& k
void IDBCursor::continuePrimaryKey(ExecutionContext* context, const ScriptValue& keyValue, const ScriptValue& primaryKeyValue, ExceptionState& exceptionState)
{
IDB_TRACE("IDBCursor::continuePrimaryKey");
- DOMRequestState requestState(toIsolate(context));
- RefPtr<IDBKey> key = scriptValueToIDBKey(&requestState, keyValue);
- RefPtr<IDBKey> primaryKey = scriptValueToIDBKey(&requestState, primaryKeyValue);
+ RefPtr<IDBKey> key = scriptValueToIDBKey(toIsolate(context), keyValue);
+ RefPtr<IDBKey> primaryKey = scriptValueToIDBKey(toIsolate(context), primaryKeyValue);
if (!key->isValid() || !primaryKey->isValid()) {
exceptionState.throwDOMException(DataError, IDBDatabase::notValidKeyErrorMessage);
return;
@@ -331,8 +330,7 @@ ScriptValue IDBCursor::value(NewScriptState* scriptState)
if (metadata.autoIncrement && !metadata.keyPath.isNull()) {
value = IDBAny::create(m_value, m_primaryKey, metadata.keyPath);
#ifndef NDEBUG
- DOMRequestState requestState(scriptState->isolate());
- assertPrimaryKeyValidOrInjectable(&requestState, m_value, m_primaryKey, metadata.keyPath);
+ assertPrimaryKeyValidOrInjectable(scriptState, m_value, m_primaryKey, metadata.keyPath);
#endif
} else {
value = IDBAny::create(m_value);
« no previous file with comments | « Source/modules/indexeddb/IDBCursor.h ('k') | Source/modules/indexeddb/IDBFactory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698