mirror of
https://github.com/servo/servo.git
synced 2025-10-02 17:49:16 +01:00
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:
parent
ba5f36b671
commit
d12dc23083
60 changed files with 378 additions and 280 deletions
|
@ -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()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue