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

@ -11,6 +11,7 @@ use std::sync::{Arc, Mutex, RwLock, Weak};
use base::generic_channel;
use base::id::WebViewId;
use base::threadpool::ThreadPool;
use embedder_traits::{EmbedderMsg, EmbedderProxy, FilterPattern};
use headers::{ContentLength, ContentRange, ContentType, HeaderMap, HeaderMapExt, Range};
use http::header::{self, HeaderValue};
@ -33,7 +34,6 @@ use uuid::Uuid;
use crate::fetch::methods::{CancellationListener, Data, RangeRequestBounds};
use crate::protocols::get_range_request_bounds;
use crate::resource_thread::CoreResourceThreadPool;
pub const FILE_CHUNK_SIZE: usize = 32768; // 32 KB
@ -79,14 +79,11 @@ enum FileImpl {
pub struct FileManager {
embedder_proxy: EmbedderProxy,
store: Arc<FileManagerStore>,
thread_pool: Weak<CoreResourceThreadPool>,
thread_pool: Weak<ThreadPool>,
}
impl FileManager {
pub fn new(
embedder_proxy: EmbedderProxy,
pool_handle: Weak<CoreResourceThreadPool>,
) -> FileManager {
pub fn new(embedder_proxy: EmbedderProxy, pool_handle: Weak<ThreadPool>) -> FileManager {
FileManager {
embedder_proxy,
store: Arc::new(FileManagerStore::new()),