#ifndef WebIDBDatabase_h
#define WebIDBDatabase_h
#include "WebCommon.h"
#include "WebIDBCursor.h"
#include "WebIDBMetadata.h"
namespace blink {
class WebData;
class WebIDBCallbacks;
class WebIDBDatabaseCallbacks;
class WebIDBDatabaseError;
class WebIDBKey;
class WebIDBKeyPath;
class WebIDBKeyRange;
class WebIDBDatabase {
public:
virtual ~WebIDBDatabase() { }
enum TransactionMode {
TransactionReadOnly = 0,
TransactionReadWrite,
TransactionVersionChange,
};
virtual void createObjectStore(long long transactionId, long long objectStoreId, const WebString& name, const WebIDBKeyPath&, bool autoIncrement) { BLINK_ASSERT_NOT_REACHED(); }
virtual void deleteObjectStore(long long transactionId, long long objectStoreId) { BLINK_ASSERT_NOT_REACHED(); }
virtual void createTransaction(long long id, WebIDBDatabaseCallbacks*, const WebVector<long long>& scope, TransactionMode) { BLINK_ASSERT_NOT_REACHED(); }
virtual void close() { BLINK_ASSERT_NOT_REACHED(); }
virtual void forceClose() { BLINK_ASSERT_NOT_REACHED(); }
virtual void abort(long long transactionId) { BLINK_ASSERT_NOT_REACHED(); }
virtual void commit(long long transactionId) { BLINK_ASSERT_NOT_REACHED(); }
virtual void createIndex(long long transactionId, long long objectStoreId, long long indexId, const WebString& name, const WebIDBKeyPath&, bool unique, bool multiEntry) { BLINK_ASSERT_NOT_REACHED(); }
virtual void deleteIndex(long long transactionId, long long objectStoreId, long long indexId) { BLINK_ASSERT_NOT_REACHED(); }
enum TaskType {
NormalTask = 0,
PreemptiveTask,
TaskTypeLast = PreemptiveTask
};
enum PutMode {
AddOrUpdate,
AddOnly,
CursorUpdate,
PutModeLast = CursorUpdate
};
static const long long minimumIndexId = 30;
typedef WebVector<WebIDBKey> WebIndexKeys;
virtual void get(long long transactionId, long long objectStoreId, long long indexId, const WebIDBKeyRange&, bool keyOnly, WebIDBCallbacks*) { BLINK_ASSERT_NOT_REACHED(); }
virtual void put(long long transactionId, long long objectStoreId, const WebData& value, const WebIDBKey&, PutMode, WebIDBCallbacks*, const WebVector<long long>& indexIds, const WebVector<WebIndexKeys>&) { BLINK_ASSERT_NOT_REACHED(); }
virtual void setIndexKeys(long long transactionId, long long objectStoreId, const WebIDBKey&, const WebVector<long long>& indexIds, const WebVector<WebIndexKeys>&) { BLINK_ASSERT_NOT_REACHED(); }
virtual void setIndexesReady(long long transactionId, long long objectStoreId, const WebVector<long long>& indexIds) { BLINK_ASSERT_NOT_REACHED(); }
virtual void openCursor(long long transactionId, long long objectStoreId, long long indexId, const WebIDBKeyRange&, WebIDBCursor::Direction, bool keyOnly, TaskType, WebIDBCallbacks*) { BLINK_ASSERT_NOT_REACHED(); }
virtual void count(long long transactionId, long long objectStoreId, long long indexId, const WebIDBKeyRange&, WebIDBCallbacks*) { BLINK_ASSERT_NOT_REACHED(); }
virtual void deleteRange(long long transactionId, long long objectStoreId, const WebIDBKeyRange&, WebIDBCallbacks*) { BLINK_ASSERT_NOT_REACHED(); }
virtual void clear(long long transactionId, long long objectStoreId, WebIDBCallbacks*) { BLINK_ASSERT_NOT_REACHED(); }
protected:
WebIDBDatabase() { }
};
}
#endif