This source file includes following definitions.
- createUndefined
- createNull
- createString
- m_integer
- domStringList
- idbCursor
- idbCursorWithValue
- idbDatabase
- idbIndex
- idbObjectStore
- idbTransaction
- key
- keyPath
- buffer
- string
- integer
- m_integer
- m_integer
- m_integer
- m_integer
- m_integer
- m_integer
- m_integer
- m_integer
- m_integer
- m_integer
- m_integer
- m_integer
#include "config.h"
#include "modules/indexeddb/IDBAny.h"
#include "core/dom/DOMStringList.h"
#include "modules/indexeddb/IDBCursorWithValue.h"
#include "modules/indexeddb/IDBDatabase.h"
#include "modules/indexeddb/IDBIndex.h"
#include "modules/indexeddb/IDBObjectStore.h"
namespace WebCore {
PassRefPtr<IDBAny> IDBAny::createUndefined()
{
return adoptRef(new IDBAny(UndefinedType));
}
PassRefPtr<IDBAny> IDBAny::createNull()
{
return adoptRef(new IDBAny(NullType));
}
PassRefPtr<IDBAny> IDBAny::createString(const String& value)
{
return adoptRef(new IDBAny(value));
}
IDBAny::IDBAny(Type type)
: m_type(type)
, m_integer(0)
{
ASSERT(type == UndefinedType || type == NullType);
}
IDBAny::~IDBAny()
{
}
DOMStringList* IDBAny::domStringList() const
{
ASSERT(m_type == DOMStringListType);
return m_domStringList.get();
}
IDBCursor* IDBAny::idbCursor() const
{
ASSERT(m_type == IDBCursorType);
ASSERT_WITH_SECURITY_IMPLICATION(m_idbCursor->isKeyCursor());
return m_idbCursor.get();
}
IDBCursorWithValue* IDBAny::idbCursorWithValue() const
{
ASSERT(m_type == IDBCursorWithValueType);
ASSERT_WITH_SECURITY_IMPLICATION(m_idbCursor->isCursorWithValue());
return toIDBCursorWithValue(m_idbCursor.get());
}
IDBDatabase* IDBAny::idbDatabase() const
{
ASSERT(m_type == IDBDatabaseType);
return m_idbDatabase.get();
}
IDBIndex* IDBAny::idbIndex() const
{
ASSERT(m_type == IDBIndexType);
return m_idbIndex.get();
}
IDBObjectStore* IDBAny::idbObjectStore() const
{
ASSERT(m_type == IDBObjectStoreType);
return m_idbObjectStore.get();
}
IDBTransaction* IDBAny::idbTransaction() const
{
ASSERT(m_type == IDBTransactionType);
return m_idbTransaction.get();
}
const IDBKey* IDBAny::key() const
{
ASSERT(m_type == KeyType || m_type == BufferKeyAndKeyPathType);
return m_idbKey.get();
}
const IDBKeyPath& IDBAny::keyPath() const
{
ASSERT(m_type == KeyPathType || m_type == BufferKeyAndKeyPathType);
return m_idbKeyPath;
}
SharedBuffer* IDBAny::buffer() const
{
ASSERT(m_type == BufferType || m_type == BufferKeyAndKeyPathType);
return m_buffer.get();
}
const String& IDBAny::string() const
{
ASSERT(m_type == StringType);
return m_string;
}
int64_t IDBAny::integer() const
{
ASSERT(m_type == IntegerType);
return m_integer;
}
IDBAny::IDBAny(PassRefPtr<DOMStringList> value)
: m_type(DOMStringListType)
, m_domStringList(value)
, m_integer(0)
{
}
IDBAny::IDBAny(PassRefPtr<IDBCursor> value)
: m_type(value->isCursorWithValue() ? IDBCursorWithValueType : IDBCursorType)
, m_idbCursor(value)
, m_integer(0)
{
}
IDBAny::IDBAny(PassRefPtr<IDBDatabase> value)
: m_type(IDBDatabaseType)
, m_idbDatabase(value)
, m_integer(0)
{
}
IDBAny::IDBAny(PassRefPtr<IDBIndex> value)
: m_type(IDBIndexType)
, m_idbIndex(value)
, m_integer(0)
{
}
IDBAny::IDBAny(PassRefPtr<IDBTransaction> value)
: m_type(IDBTransactionType)
, m_idbTransaction(value)
, m_integer(0)
{
}
IDBAny::IDBAny(PassRefPtr<IDBObjectStore> value)
: m_type(IDBObjectStoreType)
, m_idbObjectStore(value)
, m_integer(0)
{
}
IDBAny::IDBAny(PassRefPtr<SharedBuffer> value)
: m_type(BufferType)
, m_buffer(value)
, m_integer(0)
{
}
IDBAny::IDBAny(PassRefPtr<SharedBuffer> value, PassRefPtr<IDBKey> key, const IDBKeyPath& keyPath)
: m_type(BufferKeyAndKeyPathType)
, m_idbKey(key)
, m_idbKeyPath(keyPath)
, m_buffer(value)
, m_integer(0)
{
}
IDBAny::IDBAny(PassRefPtr<IDBKey> key)
: m_type(KeyType)
, m_idbKey(key)
, m_integer(0)
{
}
IDBAny::IDBAny(const IDBKeyPath& value)
: m_type(KeyPathType)
, m_idbKeyPath(value)
, m_integer(0)
{
}
IDBAny::IDBAny(const String& value)
: m_type(StringType)
, m_string(value)
, m_integer(0)
{
}
IDBAny::IDBAny(int64_t value)
: m_type(IntegerType)
, m_integer(value)
{
}
}