summaryrefslogtreecommitdiffstats
path: root/WebCore/storage/IDBObjectStore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/storage/IDBObjectStore.cpp')
-rw-r--r--WebCore/storage/IDBObjectStore.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/WebCore/storage/IDBObjectStore.cpp b/WebCore/storage/IDBObjectStore.cpp
index b457cd1..4c5cf34 100644
--- a/WebCore/storage/IDBObjectStore.cpp
+++ b/WebCore/storage/IDBObjectStore.cpp
@@ -31,6 +31,7 @@
#include "IDBIndex.h"
#include "IDBKey.h"
#include "IDBKeyRange.h"
+#include "IDBTransactionBackendInterface.h"
#include "SerializedScriptValue.h"
#include <wtf/UnusedParam.h>
@@ -38,8 +39,9 @@
namespace WebCore {
-IDBObjectStore::IDBObjectStore(PassRefPtr<IDBObjectStoreBackendInterface> idbObjectStore)
+IDBObjectStore::IDBObjectStore(PassRefPtr<IDBObjectStoreBackendInterface> idbObjectStore, IDBTransactionBackendInterface* transaction)
: m_objectStore(idbObjectStore)
+ , m_transaction(transaction)
{
// We pass a reference to this object before it can be adopted.
relaxAdoptionRequirement();
@@ -62,9 +64,9 @@ PassRefPtr<DOMStringList> IDBObjectStore::indexNames() const
PassRefPtr<IDBRequest> IDBObjectStore::get(ScriptExecutionContext* context, PassRefPtr<IDBKey> key)
{
- RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this));
- m_objectStore->get(key, request);
- return request;
+ RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
+ m_objectStore->get(key, request, m_transaction.get());
+ return request.release();
}
PassRefPtr<IDBRequest> IDBObjectStore::add(ScriptExecutionContext* context, PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key)
@@ -97,8 +99,10 @@ PassRefPtr<IDBRequest> IDBObjectStore::createIndex(ScriptExecutionContext* conte
PassRefPtr<IDBIndex> IDBObjectStore::index(const String& name)
{
+ // FIXME: If this is null, we should raise a NOT_FOUND_ERR.
RefPtr<IDBIndexBackendInterface> index = m_objectStore->index(name);
- ASSERT(index); // FIXME: If this is null, we should raise a NOT_FOUND_ERR.
+ if (!index)
+ return 0;
return IDBIndex::create(index.release());
}