From 2daae5fd11344eaa88a0d92b0f6d65f8d2255c00 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Thu, 2 Jun 2011 12:07:03 +0100 Subject: Merge WebKit at r84325: Initial merge by git. Change-Id: Ic1a909300ecc0a13ddc6b4e784371d2ac6e3d59b --- Source/WebCore/storage/IDBBackingStore.h | 52 ++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 22 deletions(-) (limited to 'Source/WebCore/storage/IDBBackingStore.h') diff --git a/Source/WebCore/storage/IDBBackingStore.h b/Source/WebCore/storage/IDBBackingStore.h index 29523a2..4b96442 100644 --- a/Source/WebCore/storage/IDBBackingStore.h +++ b/Source/WebCore/storage/IDBBackingStore.h @@ -50,30 +50,38 @@ public: virtual bool setIDBDatabaseMetaData(const String& name, const String& version, int64_t& rowId, bool invalidRowId) = 0; virtual void getObjectStores(int64_t databaseId, Vector& foundIds, Vector& foundNames, Vector& foundKeyPaths, Vector& foundAutoIncrementFlags) = 0; - virtual bool createObjectStore(const String& name, const String& keyPath, bool autoIncrement, int64_t databaseId, int64_t& assignedObjectStoreId) = 0; - virtual void deleteObjectStore(int64_t objectStoreId) = 0; - virtual String getObjectStoreRecord(int64_t objectStoreId, const IDBKey&) = 0; - virtual bool putObjectStoreRecord(int64_t objectStoreId, const IDBKey&, const String& value, int64_t& rowId, bool invalidRowId) = 0; - virtual void clearObjectStore(int64_t objectStoreId) = 0; - virtual void deleteObjectStoreRecord(int64_t objectStoreId, int64_t objectStoreDataId) = 0; - virtual double nextAutoIncrementNumber(int64_t objectStoreId) = 0; - virtual bool keyExistsInObjectStore(int64_t objectStoreId, const IDBKey&, int64_t& foundObjectStoreDataId) = 0; + virtual bool createObjectStore(int64_t databaseId, const String& name, const String& keyPath, bool autoIncrement, int64_t& assignedObjectStoreId) = 0; + virtual void deleteObjectStore(int64_t databaseId, int64_t objectStoreId) = 0; + + class ObjectStoreRecordIdentifier : public RefCounted { + public: + virtual bool isValid() const = 0; + virtual ~ObjectStoreRecordIdentifier() {} + }; + virtual PassRefPtr createInvalidRecordIdentifier() = 0; + + virtual String getObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const IDBKey&) = 0; + virtual bool putObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, ObjectStoreRecordIdentifier*) = 0; + virtual void clearObjectStore(int64_t databaseId, int64_t objectStoreId) = 0; + virtual void deleteObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier*) = 0; + virtual double nextAutoIncrementNumber(int64_t databaseId, int64_t objectStoreId) = 0; + virtual bool keyExistsInObjectStore(int64_t databaseId, int64_t objectStoreId, const IDBKey&, ObjectStoreRecordIdentifier* foundRecordIdentifier) = 0; class ObjectStoreRecordCallback { public: - virtual bool callback(int64_t objectStoreDataId, const String& value) = 0; + virtual bool callback(const ObjectStoreRecordIdentifier*, const String& value) = 0; virtual ~ObjectStoreRecordCallback() {}; }; - virtual bool forEachObjectStoreRecord(int64_t objectStoreId, ObjectStoreRecordCallback&) = 0; + virtual bool forEachObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback&) = 0; - virtual void getIndexes(int64_t objectStoreId, Vector& foundIds, Vector& foundNames, Vector& foundKeyPaths, Vector& foundUniqueFlags) = 0; - virtual bool createIndex(int64_t objectStoreId, const String& name, const String& keyPath, bool isUnique, int64_t& indexId) = 0; - virtual void deleteIndex(int64_t indexId) = 0; - virtual bool putIndexDataForRecord(int64_t indexId, const IDBKey&, int64_t objectStoreDataId) = 0; - virtual bool deleteIndexDataForRecord(int64_t objectStoreDataId) = 0; - virtual String getObjectViaIndex(int64_t indexId, const IDBKey&) = 0; - virtual PassRefPtr getPrimaryKeyViaIndex(int64_t indexId, const IDBKey&) = 0; - virtual bool keyExistsInIndex(int64_t indexId, const IDBKey&) = 0; + virtual void getIndexes(int64_t databaseId, int64_t objectStoreId, Vector& foundIds, Vector& foundNames, Vector& foundKeyPaths, Vector& foundUniqueFlags) = 0; + virtual bool createIndex(int64_t databaseId, int64_t objectStoreId, const String& name, const String& keyPath, bool isUnique, int64_t& indexId) = 0; + virtual void deleteIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId) = 0; + virtual bool putIndexDataForRecord(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const ObjectStoreRecordIdentifier*) = 0; + virtual bool deleteIndexDataForRecord(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const ObjectStoreRecordIdentifier*) = 0; + virtual String getObjectViaIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&) = 0; + virtual PassRefPtr getPrimaryKeyViaIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&) = 0; + virtual bool keyExistsInIndex(int64_t databaseid, int64_t objectStoreId, int64_t indexId, const IDBKey&) = 0; class Cursor : public RefCounted { public: @@ -81,14 +89,14 @@ public: virtual PassRefPtr key() = 0; virtual PassRefPtr primaryKey() = 0; virtual String value() = 0; - virtual int64_t objectStoreDataId() = 0; + virtual PassRefPtr objectStoreRecordIdentifier() = 0; virtual int64_t indexDataId() = 0; virtual ~Cursor() {}; }; - virtual PassRefPtr openObjectStoreCursor(int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction) = 0; - virtual PassRefPtr openIndexKeyCursor(int64_t indexId, const IDBKeyRange*, IDBCursor::Direction) = 0; - virtual PassRefPtr openIndexCursor(int64_t indexId, const IDBKeyRange*, IDBCursor::Direction) = 0; + virtual PassRefPtr openObjectStoreCursor(int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction) = 0; + virtual PassRefPtr openIndexKeyCursor(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction) = 0; + virtual PassRefPtr openIndexCursor(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction) = 0; class Transaction : public RefCounted { public: -- cgit v1.1