storage: Move storage related backend threads to their own crate (#39418)

This PR moves storage related APIs (currently just webstorage and
indexeddb) into their own crate. This reduces the congestion in the net
thread.

Related Zulip thread:
https://servo.zulipchat.com/#narrow/channel/263398-general/topic/indexedDB.20location/with/535911631

Sub PRs:
- [x] Move shared storage/net stuff to base (`IpcSend` and
`CoreResourcePool`) #39419

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Ashwin Naren 2025-09-28 01:00:20 -07:00 committed by GitHub
parent ba5f36b671
commit d12dc23083
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
60 changed files with 378 additions and 280 deletions

View file

@ -9,6 +9,7 @@ use std::sync::{Arc, Mutex};
use std::{mem, thread};
use base::id::PipelineId;
use base::threadpool::ThreadPool;
use compositing_traits::{CrossProcessCompositorApi, ImageUpdate, SerializableImageData};
use imsz::imsz_from_reader;
use ipc_channel::ipc::{IpcSender, IpcSharedMemory};
@ -35,8 +36,6 @@ use webrender_api::{
ImageDescriptor, ImageDescriptorFlags, ImageFormat, ImageKey as WebRenderImageKey,
};
use crate::resource_thread::CoreResourceThreadPool;
// We bake in rippy.png as a fallback, in case the embedder does not provide
// a rippy resource. this version is 253 bytes large, don't exchange it against
// something in higher resolution.
@ -703,7 +702,7 @@ pub struct ImageCacheImpl {
store: Arc<Mutex<ImageCacheStore>>,
/// Thread pool for image decoding
thread_pool: Arc<CoreResourceThreadPool>,
thread_pool: Arc<ThreadPool>,
}
impl ImageCache for ImageCacheImpl {
@ -730,10 +729,7 @@ impl ImageCache for ImageCacheImpl {
pipeline_id: None,
key_cache: KeyCache::new(),
})),
thread_pool: Arc::new(CoreResourceThreadPool::new(
thread_count,
"ImageCache".to_string(),
)),
thread_pool: Arc::new(ThreadPool::new(thread_count, "ImageCache".to_string())),
}
}