mirror of
https://github.com/servo/servo.git
synced 2025-07-19 13:23:46 +01:00
IndexedDB: communicate transaction errors and async response data more precisely (#38027)
Digging into several crashing tests revealed that committing transactions is a fallible operation. Propagating those errors led to exposing many new errors caused by the IDBRequest implementation assuming that all successful responses contained a structured clone. The end result is a bunch of new test failures that were previously hidden. Testing: Existing test coverage is sufficient. --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
027954dbad
commit
312985faff
9 changed files with 196 additions and 51 deletions
|
@ -192,11 +192,20 @@ pub enum SyncOperation {
|
|||
Exit(IpcSender<()>),
|
||||
}
|
||||
|
||||
/// The set of all kinds of results that can be returned from async operations.
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub enum IdbResult {
|
||||
/// The key used to perform an async operation.
|
||||
Key(IndexedDBKeyType),
|
||||
/// A structured clone of a value retrieved from an object store.
|
||||
Data(Vec<u8>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub enum IndexedDBThreadMsg {
|
||||
Sync(SyncOperation),
|
||||
Async(
|
||||
IpcSender<Option<Vec<u8>>>, // Sender to send the result of the async operation
|
||||
IpcSender<Result<Option<IdbResult>, ()>>, // Sender to send the result of the async operation
|
||||
ImmutableOrigin,
|
||||
String, // Database
|
||||
String, // ObjectStore
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue