/
githubmirror
/
servo
Обзор
Документация
Войти
/
githubmirror
/
servo
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
components/storage/storage_thread.rs
63 строки
2 KB
Gregory Terzian
serviceworkers: initial plumbing into storage endpoint for service worker caches (#46247)
21 июл 2026, 17:21
Не верифицирован
21 июл 2026, 17:21
f52360c
Код
Авторство
О чём код?
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ use std::path::PathBuf; use profile_traits::mem::ProfilerChan as MemProfilerChan; use servo_base::generic_channel::GenericSender; use storage_traits::StorageThreads; use storage_traits::cache_storage::CacheStorageThreadHandle; use storage_traits::client_storage::ClientStorageThreadHandle; use storage_traits::indexeddb::IndexedDBThreadMsg; use storage_traits::webstorage_thread::WebStorageThreadMsg; use crate::{ CacheStorageThreadFactory, ClientStorageThreadFactory, IndexedDBThreadFactory, WebStorageThreadFactory, }; fn new_storage_thread_group( mem_profiler_chan: MemProfilerChan, config_dir: Option<PathBuf>, temporary_storage: bool, label: &str, ) -> StorageThreads { let client_storage: ClientStorageThreadHandle = ClientStorageThreadFactory::new(config_dir.clone(), temporary_storage); let idb: GenericSender<IndexedDBThreadMsg> = IndexedDBThreadFactory::new( mem_profiler_chan.clone(), format!("indexedDB-reporter-{label}"), ); let web_storage: GenericSender<WebStorageThreadMsg> = WebStorageThreadFactory::new( config_dir.clone(), mem_profiler_chan, format!("storage-reporter-{label}"), ); let cache_storage: CacheStorageThreadHandle = CacheStorageThreadFactory::new(config_dir, temporary_storage); StorageThreads::new( client_storage.into(), idb, web_storage, cache_storage.into(), ) } pub fn new_storage_threads( mem_profiler_chan: MemProfilerChan, config_dir: Option<PathBuf>, temporary_storage: bool, ) -> (StorageThreads, StorageThreads) { let private_storage_threads = new_storage_thread_group( mem_profiler_chan.clone(), config_dir.clone(), temporary_storage, "private", ); let public_storage_threads = new_storage_thread_group(mem_profiler_chan, config_dir, temporary_storage, "public"); (private_storage_threads, public_storage_threads) }