aboutsummaryrefslogtreecommitdiffstats
path: root/components/shared/net
diff options
context:
space:
mode:
Diffstat (limited to 'components/shared/net')
-rw-r--r--components/shared/net/pub_domains.rs8
-rw-r--r--components/shared/net/storage_thread.rs4
2 files changed, 11 insertions, 1 deletions
diff --git a/components/shared/net/pub_domains.rs b/components/shared/net/pub_domains.rs
index cbbb2b465b2..6e6f883cd2f 100644
--- a/components/shared/net/pub_domains.rs
+++ b/components/shared/net/pub_domains.rs
@@ -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
diff --git a/components/shared/net/storage_thread.rs b/components/shared/net/storage_thread.rs
index 0253603016e..2ba0aa12445 100644
--- a/components/shared/net/storage_thread.rs
+++ b/components/shared/net/storage_thread.rs
@@ -4,6 +4,7 @@
use ipc_channel::ipc::IpcSender;
use malloc_size_of_derive::MallocSizeOf;
+use profile_traits::mem::ReportsChan;
use serde::{Deserialize, Serialize};
use servo_url::ServoUrl;
@@ -45,4 +46,7 @@ pub enum StorageThreadMsg {
/// send a reply when done cleaning up thread resources and then shut it down
Exit(IpcSender<()>),
+
+ /// Measure memory used by this thread and send the report over the provided channel.
+ CollectMemoryReport(ReportsChan),
}