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,
impl<Entry> CascadeDataCache<Entry>where
Entry: CascadeDataCacheEntry,
fn new() -> Self
fn len(&self) -> usize
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,
Sourcefn take_unused(&mut self) -> SmallVec<[Arc<Entry>; 3]> ⓘ
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.