IDB: Implement IDBObjectStore.delete()
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Feb 2014 21:00:30 +0000 (21:00 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Feb 2014 21:00:30 +0000 (21:00 +0000)
commit619c3341d3ec617c866d8c4878f2f857337da75b
tree01afd20754c7e5c57e09060263ba3c04e1c6eb8d
parent41e0e8b14e7278e29e45296c1b5f07d7a382d561
IDB: Implement IDBObjectStore.delete()
https://bugs.webkit.org/show_bug.cgi?id=127880

Reviewed by Sam Weinig.

Source/WebCore:

* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::compare): Make this const.
* Modules/indexeddb/IDBKeyData.h:

* Modules/indexeddb/IDBKeyRangeData.cpp:
(WebCore::IDBKeyRangeData::isExactlyOneKey): Returns whether or not
  the key range is known to represent precisely one key.
* Modules/indexeddb/IDBKeyRangeData.h:

* WebCore.exp.in:

Source/WebKit2:

Implementing IDBObjectStore.delete() involves filling in the already-stubbed deleteRange() method.

* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::deleteRangeInBackingStore): Call through to the backing store.

* DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteRange): Call deleteRecord on each key represented
  by the passed-in keyRange. This involves collecting each key using a cursor.
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteRecord): Delete an individual record from the
  object store and all associated indexes.
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:

Teach the SQLiteIDBCursor to remember if it ended in an error condition:
* DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
(WebKit::SQLiteIDBCursor::SQLiteIDBCursor):
(WebKit::SQLiteIDBCursor::advanceOnce):
* DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.h:
(WebKit::SQLiteIDBCursor::didError):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163249 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBKeyData.cpp
Source/WebCore/Modules/indexeddb/IDBKeyData.h
Source/WebCore/Modules/indexeddb/IDBKeyRangeData.cpp
Source/WebCore/Modules/indexeddb/IDBKeyRangeData.h
Source/WebCore/WebCore.exp.in
Source/WebKit2/ChangeLog
Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp
Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h
Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp
Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.h
Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp
Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h