Initial IndexedDB Support (#33044)

Adds indexeddb support to servo. At the moment heed is being used as the
backend, although this can be swapped out by implementing `KvsEngine`.
This PR adds a thread + a thread pool for Indexeddb related operations.
Also `database_access_task_source` is added for Indexeddb related
operations.

This is a partial rewrite of #25214. (Reopened due to branching issue)

Fixes #6963

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Rasmus Viitanen <rasviitanen@gmail.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Ashwin Naren 2025-06-18 22:19:07 -07:00 committed by GitHub
parent d33cf8fbd1
commit ed9a79f3f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
259 changed files with 11141 additions and 8 deletions

View file

@ -23,6 +23,7 @@ use ipc_channel::ipc::{self, IpcReceiver, IpcReceiverSet, IpcSender};
use log::{debug, trace, warn};
use net_traits::blob_url_store::parse_blob_url;
use net_traits::filemanager_thread::FileTokenCheck;
use net_traits::indexeddb_thread::IndexedDBThreadMsg;
use net_traits::pub_domains::public_suffix_list_size_of;
use net_traits::request::{Destination, RequestBuilder, RequestId};
use net_traits::response::{Response, ResponseInit};
@ -56,6 +57,7 @@ use crate::filemanager_thread::FileManager;
use crate::hsts::{self, HstsList};
use crate::http_cache::HttpCache;
use crate::http_loader::{HttpState, http_redirect_fetch};
use crate::indexeddb::idb_thread::IndexedDBThreadFactory;
use crate::protocols::ProtocolRegistry;
use crate::request_interceptor::RequestInterceptor;
use crate::storage_thread::StorageThreadFactory;
@ -104,11 +106,12 @@ pub fn new_resource_threads(
ignore_certificate_errors,
protocols,
);
let idb: IpcSender<IndexedDBThreadMsg> = IndexedDBThreadFactory::new(config_dir.clone());
let storage: IpcSender<StorageThreadMsg> =
StorageThreadFactory::new(config_dir, mem_profiler_chan);
(
ResourceThreads::new(public_core, storage.clone()),
ResourceThreads::new(private_core, storage),
ResourceThreads::new(public_core, storage.clone(), idb.clone()),
ResourceThreads::new(private_core, storage, idb),
)
}