IDBIndexBackendProxy.cpp [plain text]
#include "config.h"
#include "IDBIndexBackendProxy.h"
#if ENABLE(INDEXED_DATABASE)
#include "IDBCallbacks.h"
#include "IDBKeyRange.h"
#include "IDBTransactionBackendProxy.h"
#include "WebIDBCallbacksImpl.h"
#include "WebIDBDatabaseError.h"
#include "WebIDBIndex.h"
#include "WebIDBKey.h"
#include "WebIDBKeyRange.h"
using namespace WebCore;
namespace WebKit {
PassRefPtr<IDBIndexBackendInterface> IDBIndexBackendProxy::create(PassOwnPtr<WebIDBIndex> index)
{
return adoptRef(new IDBIndexBackendProxy(index));
}
IDBIndexBackendProxy::IDBIndexBackendProxy(PassOwnPtr<WebIDBIndex> index)
: m_webIDBIndex(index)
{
}
IDBIndexBackendProxy::~IDBIndexBackendProxy()
{
}
String IDBIndexBackendProxy::name()
{
return m_webIDBIndex->name();
}
String IDBIndexBackendProxy::storeName()
{
return m_webIDBIndex->storeName();
}
String IDBIndexBackendProxy::keyPath()
{
return m_webIDBIndex->keyPath().string();
}
bool IDBIndexBackendProxy::unique()
{
return m_webIDBIndex->unique();
}
bool IDBIndexBackendProxy::multiEntry()
{
return m_webIDBIndex->multiEntry();
}
void IDBIndexBackendProxy::openCursor(PassRefPtr<IDBKeyRange> keyRange, unsigned short direction, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
{
IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction);
m_webIDBIndex->openObjectCursor(keyRange, direction, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec);
}
void IDBIndexBackendProxy::count(PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
{
IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction);
m_webIDBIndex->count(keyRange, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec);
}
void IDBIndexBackendProxy::openKeyCursor(PassRefPtr<IDBKeyRange> keyRange, unsigned short direction, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
{
IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction);
m_webIDBIndex->openKeyCursor(keyRange, direction, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec);
}
void IDBIndexBackendProxy::get(PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
{
IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction);
m_webIDBIndex->getObject(keyRange, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec);
}
void IDBIndexBackendProxy::getKey(PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
{
IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction);
m_webIDBIndex->getKey(keyRange, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec);
}
}
#endif // ENABLE(INDEXED_DATABASE)