IDB: create object store support
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Jan 2014 06:31:16 +0000 (06:31 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Jan 2014 06:31:16 +0000 (06:31 +0000)
commitaa57eefd294f4c5ceecc74769b7a38d6797b1e2b
tree5e8a448b273fe3bd59ade26fd2587e9d75a1ecae
parent8360790c3971b600381d31813bfac942a5c21984
IDB: create object store support
<rdar://problem/15779639> and https://bugs.webkit.org/show_bug.cgi?id=127011

Reviewed by Anders Carlsson.

Source/WebCore:

Split the 3 objects declared in IDBDatabaseMetadata into their own header files:
* Modules/indexeddb/IDBDatabaseMetadata.h:
* Modules/indexeddb/IDBIndexMetadata.h:
(WebCore::IDBIndexMetadata::IDBIndexMetadata):
* Modules/indexeddb/IDBObjectStoreMetadata.h:
(WebCore::IDBObjectStoreMetadata::IDBObjectStoreMetadata):

Add cross thread copying for IDBDatabaseMetadata:
* platform/CrossThreadCopier.cpp:
(WebCore::IDBIndexMetadata>::copy):
(WebCore::IDBObjectStoreMetadata>::copy):
* platform/CrossThreadCopier.h:

* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:

Source/WebKit2:

Add messaging/callback infrastructure for creating object stores:
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
(WebKit::DatabaseProcessIDBConnection::createObjectStore):
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in:

* WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
(WebKit::WebIDBServerConnection::createObjectStore):
(WebKit::WebIDBServerConnection::didCreateObjectStore):
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:

* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::didChangeDatabaseVersion):
(WebKit::UniqueIDBDatabase::didCreateObjectStore):
(WebKit::UniqueIDBDatabase::didCompleteBoolRequest):
(WebKit::UniqueIDBDatabase::createObjectStore):
(WebKit::UniqueIDBDatabase::createObjectStoreInBackingStore):
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:

* DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:

Add serialization helpers to save/restore an IDBKeyPath to/from disk:
* DatabaseProcess/IndexedDB/IDBSerialization.cpp:
(WebKit::serializeIDBKeyPath):
(WebKit::deserializeIDBKeyPath):
* DatabaseProcess/IndexedDB/IDBSerialization.h:

Add object store metadata to the schema, and save/restore the metadata:
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::createObjectStore):
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:

* Scripts/webkit2/messages.py:
(struct_or_class):
* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162047 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBDatabaseMetadata.h
Source/WebCore/Modules/indexeddb/IDBIndexMetadata.h [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/IDBObjectStoreMetadata.h [new file with mode: 0644]
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/CrossThreadCopier.cpp
Source/WebCore/platform/CrossThreadCopier.h
Source/WebKit2/ChangeLog
Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp
Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h
Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in
Source/WebKit2/DatabaseProcess/IndexedDB/IDBSerialization.cpp [new file with mode: 0644]
Source/WebKit2/DatabaseProcess/IndexedDB/IDBSerialization.h [new file with mode: 0644]
Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp
Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h
Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h
Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp
Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h
Source/WebKit2/Scripts/webkit2/messages.py
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in