diff --git a/servo/components/malloc_size_of/Cargo.toml b/servo/components/malloc_size_of/Cargo.toml index ab8879ea8686..82ad7a7ef2f2 100644 --- a/servo/components/malloc_size_of/Cargo.toml +++ b/servo/components/malloc_size_of/Cargo.toml @@ -21,10 +21,12 @@ servo = [ "url", "webrender_api", "xml5ever", + "content-security-policy", ] [dependencies] app_units = "0.7" +content-security-policy = {version = "0.3.0", features = ["serde"], optional = true} crossbeam-channel = { version = "0.3", optional = true } cssparser = "0.25" euclid = "0.20" diff --git a/servo/components/malloc_size_of/lib.rs b/servo/components/malloc_size_of/lib.rs index d7e0a6fdf165..1d5cbeaff1e2 100644 --- a/servo/components/malloc_size_of/lib.rs +++ b/servo/components/malloc_size_of/lib.rs @@ -48,6 +48,8 @@ extern crate app_units; #[cfg(feature = "servo")] +extern crate content_security_policy; +#[cfg(feature = "servo")] extern crate crossbeam_channel; extern crate cssparser; extern crate euclid; @@ -79,6 +81,8 @@ extern crate webrender_api; #[cfg(feature = "servo")] extern crate xml5ever; +#[cfg(feature = "servo")] +use content_security_policy as csp; #[cfg(feature = "servo")] use serde_bytes::ByteBuf; use std::hash::{BuildHasher, Hash}; @@ -833,6 +837,9 @@ malloc_size_of_is_0!(app_units::Au); malloc_size_of_is_0!(cssparser::RGBA, cssparser::TokenSerializationType); +#[cfg(feature = "servo")] +malloc_size_of_is_0!(csp::Destination); + #[cfg(feature = "url")] impl MallocSizeOf for url::Host { fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {