Commit 73adacd
committed
Implement IDBTransaction.durability
https://bugs.webkit.org/show_bug.cgi?id=228289
Reviewed by Darin Adler.
LayoutTests/imported/w3c:
* web-platform-tests/IndexedDB/idlharness.any-expected.txt:
* web-platform-tests/IndexedDB/idlharness.any.worker-expected.txt:
* web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any-expected.txt:
* web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any.worker-expected.txt:
Source/WebCore:
Spec: https://www.w3.org/TR/IndexedDB/#dom-idbtransaction-durability
https://www.w3.org/TR/IndexedDB/#dictdef-idbtransactionoptions
IDBTransaction.durability gives a hint about durability of a transaction. If it's strict, backend would try
syncing data to database file after transaction commit, which enforces durability. If it's relaxed, it means
data may stay in the OS buffer some time after transaction commit, which gives better performance. Firefox and
Chrome already implemented durability. They have different ways of setting durability, and we choose to use
TransactionOptions as spec.
Rebaselined existing tests.
New tests: storage/indexeddb/idbtransaction-durability-private.html
storage/indexeddb/idbtransaction-durability.html
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Headers.cmake:
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::transaction):
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBDatabase.idl:
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/IDBTransaction.idl:
* Modules/indexeddb/IDBTransactionDurability.h: Added.
* Modules/indexeddb/IDBTransactionDurability.idl: Added.
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
* Modules/indexeddb/server/SQLiteIDBTransaction.h:
(WebCore::IDBServer::SQLiteIDBTransaction::durability const):
* Modules/indexeddb/shared/IDBTransactionInfo.cpp:
(WebCore::IDBTransactionInfo::clientTransaction):
(WebCore::IDBTransactionInfo::IDBTransactionInfo):
(WebCore::IDBTransactionInfo::isolatedCopy):
* Modules/indexeddb/shared/IDBTransactionInfo.h:
(WebCore::IDBTransactionInfo::durability const):
(WebCore::IDBTransactionInfo::encode const):
(WebCore::IDBTransactionInfo::decode):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/sql/SQLiteDatabase.cpp:
(WebCore::checkpointModeValue):
(WebCore::SQLiteDatabase::checkpoint):
(WebCore::SQLiteDatabase::useWALJournalMode):
* platform/sql/SQLiteDatabase.h:
LayoutTests:
* storage/indexeddb/idbtransaction-durability-expected.txt: Added.
* storage/indexeddb/idbtransaction-durability-private-expected.txt: Added.
* storage/indexeddb/idbtransaction-durability-private.html: Added.
* storage/indexeddb/idbtransaction-durability.html: Added.
* storage/indexeddb/resources/idbtransaction-durability.js: Added.
(onOpenUpgradeNeeded):
(onOpenSuccess):
(onTransactionComplete):
Canonical link: https://commits.webkit.org/240055@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280415 268f45cc-cd09-0410-ab3c-d52691b4dbfc1 parent 4b00bd3 commit 73adacd
32 files changed
Lines changed: 351 additions & 39 deletions
File tree
- LayoutTests
- imported/w3c
- web-platform-tests/IndexedDB
- storage/indexeddb
- resources
- Source/WebCore
- Modules/indexeddb
- server
- WebCore.xcodeproj
- platform/sql
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
1 | 17 | | |
2 | 18 | | |
3 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
1 | 13 | | |
2 | 14 | | |
3 | 15 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| |||
Lines changed: 6 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
10 | 8 | | |
Lines changed: 6 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
10 | 8 | | |
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
0 commit comments