Source/WebCore: IDB: Support IDBObjectStore.clear()
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Jan 2014 05:45:09 +0000 (05:45 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Jan 2014 05:45:09 +0000 (05:45 +0000)
commit725e014cbb2c2dfdc38eb05311646d7ad32b487a
tree5dcecafbff7199d01a2e4d31ed280859033be48d
parent41eedd169d2e8e63eee142b0ef5b09ad2f62ffc5
Source/WebCore: IDB: Support IDBObjectStore.clear()
https://bugs.webkit.org/show_bug.cgi?id=127541

Reviewed by Anders Carlsson.

The backing store should never be performing callbacks directly:
* Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.cpp:
(WebCore::IDBServerConnectionLevelDB::clearObjectStore):

Instead, the transaction operations should do that themselves:
* Modules/indexeddb/IDBTransactionBackendOperations.cpp:
(WebCore::ClearObjectStoreOperation::perform):
* Modules/indexeddb/IDBTransactionBackendOperations.h:
(WebCore::ClearObjectStoreOperation::transaction):

Source/WebKit2: IDB: Support IDBObjectStore.clear()
https://bugs.webkit.org/show_bug.cgi?id=127541

Reviewed by Anders Carlsson.

Make the WebProcess call out to the DatabaseProcess with a clear request, and handle the
response from the DatabaseProcess:
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
(WebKit::WebIDBServerConnection::clearObjectStore):
(WebKit::WebIDBServerConnection::didClearObjectStore):
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:

Pass the clear request to the appropriate UniqueIDBDatabase:
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
(WebKit::DatabaseProcessIDBConnection::clearObjectStore):
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in:

Pass the clear request to the backing store:
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::didClearObjectStore):
(WebKit::UniqueIDBDatabase::clearObjectStore):
(WebKit::UniqueIDBDatabase::clearObjectStoreInBackingStore):
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:

Actually drop the records in the database:
* DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::clearObjectStore):
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162690 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp
Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.h
Source/WebCore/Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.cpp
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/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/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in