mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
[IndexedDB] Adhere better to the specification for idb object store related operations (#37682)
Many object store related operations require the transaction to be checked: to ensure it is still active, and, if the operation is a write, that the transaction is not read-only. I've added the `check_transaction` method to perform these checks. Additionally `Clear` was still half-implemented, so I went ahead and implemented that. --------- Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
This commit is contained in:
parent
2e3c280f46
commit
71e7019d45
3 changed files with 94 additions and 35 deletions
|
@ -262,6 +262,16 @@ impl KvsEngine for HeedEngine {
|
|||
.expect("Could not get store");
|
||||
// FIXME:(arihant2math) Return count with sender
|
||||
},
|
||||
AsyncOperation::ReadWrite(AsyncReadWriteOperation::Clear) => {
|
||||
let stores = stores
|
||||
.write()
|
||||
.expect("Could not acquire write lock on stores");
|
||||
let store = stores
|
||||
.get(&request.store_name)
|
||||
.expect("Could not get store");
|
||||
// FIXME:(arihant2math) Error handling
|
||||
let _ = store.inner.clear(&mut wtxn);
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue