Port StorageThreadMsg to GenericChannel (#38932)

This change includes the following additions to GenericChannel:
- Add a GenericSend trait which is meant to replace the `IpcSend` trait
over time, as channels are migrated. For the time being this means, that
we often need to use `GenericSend::send()` to disambiguate from the
`IpcSend::send` function, until all usages of `IpcSend` have been
replaced.
- Add an OpaqueSender impl for GenericSender
- Add a profiled version of GenericChannel. The profiling is 1:1 the
same as for the existing profiled IPC channel, namely that only the
blocked time during `recv` is measured.


Testing: No functional changes, covered by existing tests
Part of #38912

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This commit is contained in:
Jonathan Schwender 2025-08-27 03:58:43 +02:00 committed by GitHub
parent c4dcd17214
commit 32aba08be7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 113 additions and 27 deletions

View file

@ -14,6 +14,7 @@ use std::sync::{Arc, Mutex, RwLock, Weak};
use std::thread;
use std::time::Duration;
use base::generic_channel::GenericSender;
use base::id::CookieStoreId;
use cookie::Cookie;
use crossbeam_channel::Sender;
@ -112,7 +113,7 @@ pub fn new_resource_threads(
protocols,
);
let idb: IpcSender<IndexedDBThreadMsg> = IndexedDBThreadFactory::new(config_dir.clone());
let storage: IpcSender<StorageThreadMsg> =
let storage: GenericSender<StorageThreadMsg> =
StorageThreadFactory::new(config_dir, mem_profiler_chan);
(
ResourceThreads::new(public_core, storage.clone(), idb.clone()),