type UserAgentCascadeDataCache = CascadeDataCache<UserAgentCascadeData>;

Aliased Type§

struct UserAgentCascadeDataCache {
    entries: HashMap<CascadeDataCacheKey, Arc<UserAgentCascadeData>, BuildHasherDefault<FxHasher>>,
}

Fields§

§entries: HashMap<CascadeDataCacheKey, Arc<UserAgentCascadeData>, BuildHasherDefault<FxHasher>>

Implementations§

source§

impl<Entry> CascadeDataCache<Entry>where Entry: CascadeDataCacheEntry,

source

fn new() -> Self

source

fn len(&self) -> usize

source

fn lookup<'a, S>( &'a mut self, device: &Device, quirks_mode: QuirksMode, collection: SheetCollectionFlusher<'_, S>, guard: &SharedRwLockReadGuard<'_>, old_entry: &Entry ) -> Result<Option<Arc<Entry>>, AllocErr>where S: StylesheetInDocument + PartialEq + 'static,

source

fn take_unused(&mut self) -> SmallVec<[Arc<Entry>; 3]>

Returns all the cascade datas that are not being used (that is, that are held alive just by this cache).

We return them instead of dropping in place because some of them may keep alive some other documents (like the SVG documents kept alive by URL references), and thus we don’t want to drop them while locking the cache to not deadlock.

source

fn take_all(&mut self) -> FxHashMap<CascadeDataCacheKey, Arc<Entry>>