mirror of
https://github.com/servo/servo.git
synced 2025-07-03 05:23:38 +01:00
net: Avoid all-encompassing synchronous IPC return type for IndexedDB operations (#37576)
This is finishing some incomplete cleanup from #33044. Kitchen sink enum types like IndexedDBThreadReturnType make code harder to read and require ignoring variants that will never be sent in many cases. Testing: No behaviour change; existing WPT tests suffice. Fixes: part of #6963 Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
3774ef00d4
commit
30ad91b595
3 changed files with 11 additions and 27 deletions
|
@ -8,7 +8,7 @@ use std::collections::HashMap;
|
|||
use dom_struct::dom_struct;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use net_traits::IpcSend;
|
||||
use net_traits::indexeddb_thread::{IndexedDBThreadMsg, IndexedDBThreadReturnType, SyncOperation};
|
||||
use net_traits::indexeddb_thread::{IndexedDBThreadMsg, SyncOperation};
|
||||
use profile_traits::ipc;
|
||||
use stylo_atoms::Atom;
|
||||
|
||||
|
@ -178,7 +178,8 @@ impl IDBTransaction {
|
|||
.send(IndexedDBThreadMsg::Sync(upgrade_version_operation))
|
||||
.unwrap();
|
||||
// Wait for the version to be updated
|
||||
receiver.recv().unwrap();
|
||||
// TODO(jdm): This returns a Result; what do we do with an error?
|
||||
let _ = receiver.recv().unwrap();
|
||||
}
|
||||
|
||||
fn dispatch_complete(&self) {
|
||||
|
@ -260,7 +261,7 @@ impl IDBTransactionMethods<crate::DomTypeHolder> for IDBTransaction {
|
|||
let result = receiver.recv().unwrap();
|
||||
|
||||
// Step 2
|
||||
if let IndexedDBThreadReturnType::Commit(Err(_result)) = result {
|
||||
if let Err(_result) = result {
|
||||
// FIXME:(rasviitanen) also support Unknown error
|
||||
return Err(Error::QuotaExceeded);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue