mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Add memory reporting for public suffix list (#37049)
Plumbs in the memory reporting into resource_thread since that's where the other user of the public suffix list (HSTS) reports. Testing: Checked about:memory on servo.org Signed-off-by: Sebastian C <sebsebmc@gmail.com>
This commit is contained in:
parent
ec448b1423
commit
e7432cda09
2 changed files with 20 additions and 6 deletions
|
@ -19,9 +19,11 @@ use std::iter::FromIterator;
|
|||
use std::sync::LazyLock;
|
||||
|
||||
use embedder_traits::resources::{self, Resource};
|
||||
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
|
||||
use malloc_size_of_derive::MallocSizeOf;
|
||||
use servo_url::{Host, ImmutableOrigin, ServoUrl};
|
||||
|
||||
#[derive(Clone, Debug, Default)]
|
||||
#[derive(Clone, Debug, Default, MallocSizeOf)]
|
||||
pub struct PubDomainRules {
|
||||
rules: HashSet<String>,
|
||||
wildcards: HashSet<String>,
|
||||
|
@ -30,6 +32,10 @@ pub struct PubDomainRules {
|
|||
|
||||
static PUB_DOMAINS: LazyLock<PubDomainRules> = LazyLock::new(load_pub_domains);
|
||||
|
||||
pub fn public_suffix_list_size_of(ops: &mut MallocSizeOfOps) -> usize {
|
||||
PUB_DOMAINS.size_of(ops)
|
||||
}
|
||||
|
||||
impl<'a> FromIterator<&'a str> for PubDomainRules {
|
||||
fn from_iter<T>(iter: T) -> Self
|
||||
where
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue