diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-02-05 03:40:36 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-02-05 03:40:36 +0530 |
commit | 2a6707ce58df27d93e865bffb6b44d396b810c99 (patch) | |
tree | 849afb2986272f67b1abfc8720b8f530dc1c2227 | |
parent | 9e68285d35a2e7b72c9edfd9e5e37399e724c4e6 (diff) | |
parent | cb5cd8d881c39f549381e078b44f341dea733e68 (diff) | |
download | servo-2a6707ce58df27d93e865bffb6b44d396b810c99.tar.gz servo-2a6707ce58df27d93e865bffb6b44d396b810c99.zip |
Auto merge of #9532 - nox:dedup-heapsize, r=Manishearth
Say farewell to in-tree HeapSizeOf
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9532)
<!-- Reviewable:end -->
82 files changed, 423 insertions, 878 deletions
diff --git a/components/canvas_traits/Cargo.toml b/components/canvas_traits/Cargo.toml index 4fc4be5afc5..83bb07f7076 100644 --- a/components/canvas_traits/Cargo.toml +++ b/components/canvas_traits/Cargo.toml @@ -35,7 +35,9 @@ path = "../plugins" path = "../util" [dependencies] -cssparser = { version = "0.5", features = [ "serde-serialization" ] } +cssparser = {version = "0.5.2", features = ["heap_size", "serde-serialization"]} euclid = {version = "0.6.1", features = ["plugins"]} +heapsize = "0.2.5" +heapsize_plugin = "0.1.2" serde_macros = "0.6" diff --git a/components/canvas_traits/lib.rs b/components/canvas_traits/lib.rs index d54530b94fd..4dc0a5904f8 100644 --- a/components/canvas_traits/lib.rs +++ b/components/canvas_traits/lib.rs @@ -7,13 +7,14 @@ #![feature(custom_derive)] #![feature(nonzero)] #![feature(plugin)] -#![plugin(serde_macros, plugins)] +#![plugin(heapsize_plugin, plugins, serde_macros)] extern crate azure; extern crate core; extern crate cssparser; extern crate euclid; extern crate gfx_traits; +extern crate heapsize; extern crate ipc_channel; extern crate layers; extern crate offscreen_gl_context; @@ -40,7 +41,6 @@ use std::default::Default; use std::fmt; use std::str::FromStr; use std::sync::mpsc::Sender; -use util::mem::HeapSizeOf; #[derive(Clone, Deserialize, Serialize)] pub enum FillRule { diff --git a/components/compositing/Cargo.toml b/components/compositing/Cargo.toml index 965547b82db..937bc11e3bb 100644 --- a/components/compositing/Cargo.toml +++ b/components/compositing/Cargo.toml @@ -91,7 +91,7 @@ gleam = "0.2" euclid = {version = "0.6.1", features = ["plugins"]} serde = "0.6" serde_macros = "0.6" -url = "0.5.4" +url = {version = "0.5.4", features = ["heap_size"]} [target.x86_64-apple-darwin.dependencies] core-graphics = "0.2" diff --git a/components/devtools/Cargo.toml b/components/devtools/Cargo.toml index b825ef9bc48..36567380d14 100644 --- a/components/devtools/Cargo.toml +++ b/components/devtools/Cargo.toml @@ -25,7 +25,7 @@ git = "https://github.com/servo/ipc-channel" [dependencies] hyper = { version = "0.7", features = [ "serde-serialization" ] } log = "0.3" -time = "0.1" rustc-serialize = "0.3" serde = "0.6" serde_macros = "0.6" +time = "0.1" diff --git a/components/devtools_traits/Cargo.toml b/components/devtools_traits/Cargo.toml index c0a282226f7..115ab732691 100644 --- a/components/devtools_traits/Cargo.toml +++ b/components/devtools_traits/Cargo.toml @@ -20,11 +20,13 @@ git = "https://github.com/servo/ipc-channel" path = "../plugins" [dependencies] +heapsize = "0.2.5" +heapsize_plugin = "0.1.2" hyper = { version = "0.7", features = [ "serde-serialization" ] } time = "0.1" rustc-serialize = "0.3" bitflags = "0.3" serde = "0.6" serde_macros = "0.6" -url = "0.5.4" +url = {version = "0.5.4", features = ["heap_size"]} diff --git a/components/devtools_traits/lib.rs b/components/devtools_traits/lib.rs index 81644badc44..8408a79b197 100644 --- a/components/devtools_traits/lib.rs +++ b/components/devtools_traits/lib.rs @@ -13,10 +13,11 @@ #![deny(unsafe_code)] #![feature(custom_derive, plugin)] -#![plugin(serde_macros, plugins)] +#![plugin(heapsize_plugin, serde_macros)] #[macro_use] extern crate bitflags; +extern crate heapsize; extern crate hyper; extern crate ipc_channel; extern crate msg; @@ -36,7 +37,6 @@ use std::net::TcpStream; use time::Duration; use time::Tm; use url::Url; -use util::mem::HeapSizeOf; // Information would be attached to NewGlobal to be received and show in devtools. // Extend these fields if we need more information. diff --git a/components/gfx/Cargo.toml b/components/gfx/Cargo.toml index 4306c3232ac..874e95d591a 100644 --- a/components/gfx/Cargo.toml +++ b/components/gfx/Cargo.toml @@ -14,6 +14,8 @@ bitflags = "0.3" euclid = {version = "0.6.1", features = ["plugins"]} fnv = "1.0" harfbuzz-sys = "0.1" +heapsize = "0.2.5" +heapsize_plugin = "0.1.2" lazy_static = "0.1" libc = "0.2" log = "0.3" @@ -23,10 +25,10 @@ rustc-serialize = "0.3" serde = "0.6" serde_macros = "0.6" smallvec = "0.1" -string_cache = "0.2" +string_cache = {version = "0.2.7", features = ["heap_size"]} time = "0.1.12" unicode-script = { version = "0.1", features = ["harfbuzz"] } -url = "0.5.4" +url = {version = "0.5.4", features = ["heap_size"]} servo-skia = "0.20130412.0" [dependencies.plugins] diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index b6565753f36..96c953d3dfe 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -22,6 +22,7 @@ use euclid::approxeq::ApproxEq; use euclid::num::Zero; use euclid::{Matrix2D, Matrix4, Point2D, Rect, SideOffsets2D, Size2D}; use gfx_traits::{color, LayerId, LayerKind, ScrollPolicy}; +use heapsize::HeapSizeOf; use msg::constellation_msg::PipelineId; use net_traits::image::base::Image; use paint_context::PaintContext; @@ -41,7 +42,6 @@ use text::glyph::CharIndex; use util::cursor::Cursor; use util::geometry::MAX_RECT; use util::linked_list::prepend_from; -use util::mem::HeapSizeOf; use util::opts; use util::print_tree::PrintTree; use util::range::Range; @@ -1256,8 +1256,8 @@ pub struct GradientDisplayItem { impl HeapSizeOf for GradientDisplayItem { fn heap_size_of_children(&self) -> usize { + use heapsize::heap_size_of; use libc::c_void; - use util::mem::heap_size_of; // We can't measure `stops` via Vec's HeapSizeOf implementation because GradientStop isn't // defined in this module, and we don't want to import GradientStop into util::mem where diff --git a/components/gfx/font_context.rs b/components/gfx/font_context.rs index 1011d40112b..6fc010fedf3 100644 --- a/components/gfx/font_context.rs +++ b/components/gfx/font_context.rs @@ -13,6 +13,7 @@ use font::SpecifiedFontStyle; use font::{Font, FontGroup}; use font_cache_thread::FontCacheThread; use font_template::FontTemplateDescriptor; +use heapsize::HeapSizeOf; use platform::font::FontHandle; use platform::font_context::FontContextHandle; use platform::font_template::FontTemplateData; @@ -28,7 +29,6 @@ use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT}; use string_cache::Atom; use style::computed_values::{font_style, font_variant}; use util::cache::HashCache; -use util::mem::HeapSizeOf; #[cfg(any(target_os = "linux", target_os = "android", target_os = "windows"))] fn create_scaled_font(template: &Arc<FontTemplateData>, pt_size: Au) -> ScaledFont { diff --git a/components/gfx/lib.rs b/components/gfx/lib.rs index c088e7e9b97..8bc6f8c8b4a 100644 --- a/components/gfx/lib.rs +++ b/components/gfx/lib.rs @@ -15,6 +15,7 @@ #![feature(str_char)] #![feature(unique)] +#![plugin(heapsize_plugin)] #![plugin(plugins)] #![plugin(serde_macros)] @@ -45,6 +46,7 @@ extern crate gfx_traits; // shapers. For now, however, this is a hard dependency. extern crate harfbuzz_sys as harfbuzz; +extern crate heapsize; extern crate ipc_channel; extern crate layers; #[macro_use] diff --git a/components/gfx/platform/freetype/font_context.rs b/components/gfx/platform/freetype/font_context.rs index 05cbd0675f6..1ed40300639 100644 --- a/components/gfx/platform/freetype/font_context.rs +++ b/components/gfx/platform/freetype/font_context.rs @@ -10,10 +10,10 @@ use freetype::freetype::FT_Library; use freetype::freetype::FT_Memory; use freetype::freetype::FT_New_Library; use freetype::freetype::struct_FT_MemoryRec_; +use heapsize::{HeapSizeOf, heap_size_of}; use libc::{c_long, c_void}; use std::ptr; use std::rc::Rc; -use util::mem::{HeapSizeOf, heap_size_of}; // We pass a |User| struct -- via an opaque |void*| -- to FreeType each time a new instance is // created. FreeType passes it back to the ft_alloc/ft_realloc/ft_free callbacks. We use it to diff --git a/components/gfx/platform/macos/font_context.rs b/components/gfx/platform/macos/font_context.rs index e260f84b17b..e728b62aebd 100644 --- a/components/gfx/platform/macos/font_context.rs +++ b/components/gfx/platform/macos/font_context.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use util::mem::HeapSizeOf; +use heapsize::HeapSizeOf; #[derive(Clone, Debug)] pub struct FontContextHandle { diff --git a/components/gfx_traits/Cargo.toml b/components/gfx_traits/Cargo.toml index d6e132caa8f..0f7165f3494 100644 --- a/components/gfx_traits/Cargo.toml +++ b/components/gfx_traits/Cargo.toml @@ -26,5 +26,7 @@ path = "../util" [dependencies] euclid = {version = "0.6.1", features = ["plugins"]} +heapsize = "0.2.5" +heapsize_plugin = "0.1.2" serde = "0.6" serde_macros = "0.6" diff --git a/components/gfx_traits/lib.rs b/components/gfx_traits/lib.rs index 980e850b014..84e74038e40 100644 --- a/components/gfx_traits/lib.rs +++ b/components/gfx_traits/lib.rs @@ -3,13 +3,14 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #![feature(custom_derive, plugin)] -#![plugin(plugins, serde_macros)] +#![plugin(heapsize_plugin, plugins, serde_macros)] #![crate_name = "gfx_traits"] #![crate_type = "rlib"] extern crate azure; extern crate euclid; +extern crate heapsize; extern crate layers; extern crate msg; extern crate serde; diff --git a/components/layout/Cargo.toml b/components/layout/Cargo.toml index ed2f70cb494..9c494dbc07c 100644 --- a/components/layout/Cargo.toml +++ b/components/layout/Cargo.toml @@ -55,20 +55,22 @@ git = "https://github.com/servo/ipc-channel" [dependencies] app_units = {version = "0.2", features = ["plugins"]} -cssparser = { version = "0.5", features = [ "serde-serialization" ] } -log = "0.3" -fnv = "1.0" bitflags = "0.3" -rustc-serialize = "0.3" -libc = "0.2" -selectors = "0.4.1" -smallvec = "0.1" -string_cache = "0.2" +cssparser = {version = "0.5.2", features = ["heap_size", "serde-serialization"]} euclid = {version = "0.6.1", features = ["plugins"]} +fnv = "1.0" +heapsize = "0.2.5" +heapsize_plugin = "0.1.2" +libc = "0.2" +log = "0.3" +rustc-serialize = "0.3" +selectors = {version = "0.4.1", features = ["heap_size"]} serde = "0.6" -serde_macros = "0.6" serde_json = "0.5" +serde_macros = "0.6" +smallvec = "0.1" +string_cache = {version = "0.2.7", features = ["heap_size"]} time = "0.1" unicode-bidi = "0.2" unicode-script = { version = "0.1", features = ["harfbuzz"] } -url = "0.5.4" +url = {version = "0.5.4", features = ["heap_size"]} diff --git a/components/layout/context.rs b/components/layout/context.rs index 9657590be3f..134a6f03b2b 100644 --- a/components/layout/context.rs +++ b/components/layout/context.rs @@ -14,6 +14,7 @@ use fnv::FnvHasher; use gfx::font_cache_thread::FontCacheThread; use gfx::font_context::FontContext; use gfx_traits::LayerId; +use heapsize::HeapSizeOf; use ipc_channel::ipc::{self, IpcSender}; use net_traits::image::base::Image; use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheThread, ImageResponse, ImageState}; @@ -27,7 +28,6 @@ use std::sync::{Arc, Mutex}; use style::context::{LocalStyleContext, SharedStyleContext, StyleContext}; use style::matching::{ApplicableDeclarationsCache, StyleSharingCandidateCache}; use url::Url; -use util::mem::HeapSizeOf; use util::opts; struct LocalLayoutContext { diff --git a/components/layout/layout_thread.rs b/components/layout/layout_thread.rs index 206bfe4c82d..2b1950d88ce 100644 --- a/components/layout/layout_thread.rs +++ b/components/layout/layout_thread.rs @@ -28,6 +28,7 @@ use gfx::font_cache_thread::FontCacheThread; use gfx::font_context; use gfx::paint_thread::{LayoutToPaintMsg, PaintLayer}; use gfx_traits::{color, Epoch, LayerId, ScrollPolicy}; +use heapsize::HeapSizeOf; use incremental::{LayoutDamageComputation, REFLOW, REFLOW_ENTIRE_DOCUMENT, REPAINT}; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::router::ROUTER; @@ -73,7 +74,6 @@ use url::Url; use util::geometry::MAX_RECT; use util::ipc::OptionalIpcSender; use util::logical_geometry::LogicalPoint; -use util::mem::HeapSizeOf; use util::opts; use util::thread; use util::thread_state; diff --git a/components/layout/lib.rs b/components/layout/lib.rs index cf0d2f18ea1..a3b78e8c4bd 100644 --- a/components/layout/lib.rs +++ b/components/layout/lib.rs @@ -17,6 +17,7 @@ #![deny(unsafe_code)] +#![plugin(heapsize_plugin)] #![plugin(plugins)] extern crate app_units; @@ -30,6 +31,7 @@ extern crate euclid; extern crate fnv; extern crate gfx; extern crate gfx_traits; +extern crate heapsize; extern crate ipc_channel; extern crate layout_traits; extern crate libc; diff --git a/components/layout_traits/Cargo.toml b/components/layout_traits/Cargo.toml index 4729605b282..a2c4c2fba27 100644 --- a/components/layout_traits/Cargo.toml +++ b/components/layout_traits/Cargo.toml @@ -31,4 +31,4 @@ git = "https://github.com/servo/ipc-channel" [dependencies] serde = "0.6" serde_macros = "0.6" -url = "0.5.4" +url = {version = "0.5.4", features = ["heap_size"]} diff --git a/components/msg/Cargo.toml b/components/msg/Cargo.toml index 29244da4ada..129355c8ae6 100644 --- a/components/msg/Cargo.toml +++ b/components/msg/Cargo.toml @@ -21,11 +21,13 @@ git = "https://github.com/servo/ipc-channel" path = "../plugins" [dependencies] -cssparser = { version = "0.5", features = [ "serde-serialization" ] } bitflags = "0.3" +cssparser = {version = "0.5.2", features = ["heap_size", "serde-serialization"]} +euclid = {version = "0.6.1", features = ["plugins"]} +heapsize = "0.2.5" +heapsize_plugin = "0.1.2" hyper = { version = "0.7", features = [ "serde-serialization" ] } rustc-serialize = "0.3.4" -euclid = {version = "0.6.1", features = ["plugins"]} serde = "0.6" serde_macros = "0.6" -url = "0.5.4" +url = {version = "0.5.4", features = ["heap_size"]} diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs index 2ce14039a15..adefb76010c 100644 --- a/components/msg/constellation_msg.rs +++ b/components/msg/constellation_msg.rs @@ -16,7 +16,6 @@ use std::cell::Cell; use std::fmt; use url::Url; use util::geometry::{PagePx, ViewportPx}; -use util::mem::HeapSizeOf; use webdriver_msg::{LoadStatus, WebDriverScriptCommand}; #[derive(Deserialize, Serialize)] diff --git a/components/msg/lib.rs b/components/msg/lib.rs index 3b5c99b8f3c..febf188fd77 100644 --- a/components/msg/lib.rs +++ b/components/msg/lib.rs @@ -3,11 +3,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #![feature(custom_attribute, custom_derive, plugin)] -#![plugin(serde_macros, plugins)] +#![plugin(heapsize_plugin, serde_macros, plugins)] #[macro_use] extern crate bitflags; extern crate euclid; +extern crate heapsize; extern crate hyper; extern crate ipc_channel; extern crate layers; diff --git a/components/net/Cargo.toml b/components/net/Cargo.toml index b0bb98b779f..0c5e34874d0 100644 --- a/components/net/Cargo.toml +++ b/components/net/Cargo.toml @@ -38,6 +38,6 @@ cookie = "0.2" mime_guess = "1.1.1" flate2 = "0.2.0" uuid = "0.1.16" -url = "0.5.4" +url = {version = "0.5.4", features = ["heap_size"]} websocket = "0.14.0" immeta = "0.2" diff --git a/components/net_traits/Cargo.toml b/components/net_traits/Cargo.toml index 06d87f49e9d..d41649797c1 100644 --- a/components/net_traits/Cargo.toml +++ b/components/net_traits/Cargo.toml @@ -20,11 +20,13 @@ git = "https://github.com/servo/ipc-channel" path = "../plugins" [dependencies] -log = "0.3" +heapsize = "0.2.5" +heapsize_plugin = "0.1.2" hyper = { version = "0.7", features = [ "serde-serialization" ] } image = "0.5.0" +log = "0.3" serde = "0.6" serde_macros = "0.6" stb_image = "0.2" -url = "0.5.4" +url = {version = "0.5.4", features = ["heap_size"]} websocket = "0.14.0" diff --git a/components/net_traits/image_cache_thread.rs b/components/net_traits/image_cache_thread.rs index 2381efbb997..8324bae8b23 100644 --- a/components/net_traits/image_cache_thread.rs +++ b/components/net_traits/image_cache_thread.rs @@ -6,7 +6,6 @@ use ipc_channel::ipc::{self, IpcSender}; use msg::constellation_msg::{Image, ImageMetadata}; use std::sync::Arc; use url::Url; -use util::mem::HeapSizeOf; /// This is optionally passed to the image cache when requesting /// and image, and returned to the specified event loop when the diff --git a/components/net_traits/lib.rs b/components/net_traits/lib.rs index 654a64e811c..45d01a9818d 100644 --- a/components/net_traits/lib.rs +++ b/components/net_traits/lib.rs @@ -9,8 +9,9 @@ #![feature(slice_patterns)] #![feature(step_by)] #![feature(custom_attribute)] -#![plugin(serde_macros, plugins)] +#![plugin(heapsize_plugin, serde_macros)] +extern crate heapsize; extern crate hyper; extern crate image as piston_image; extern crate ipc_channel; @@ -32,7 +33,6 @@ use msg::constellation_msg::{PipelineId}; use serde::{Deserializer, Serializer}; use std::thread; use url::Url; -use util::mem::HeapSizeOf; use websocket::header; pub mod hosts; @@ -69,6 +69,7 @@ pub enum LoadContext { #[derive(Clone, Deserialize, Serialize, HeapSizeOf)] pub struct LoadData { pub url: Url, + #[ignore_heap_size_of = "Defined in hyper"] pub method: Method, #[ignore_heap_size_of = "Defined in hyper"] /// Headers that will apply to the initial request only @@ -297,6 +298,7 @@ pub struct Metadata { /// Final URL after redirects. pub final_url: Url, + #[ignore_heap_size_of = "Defined in hyper"] /// MIME type / subtype. pub content_type: Option<(ContentType)>, @@ -307,6 +309,7 @@ pub struct Metadata { /// Headers pub headers: Option<Headers>, + #[ignore_heap_size_of = "Defined in hyper"] /// HTTP Status pub status: Option<RawStatus>, } diff --git a/components/plugins/Cargo.toml b/components/plugins/Cargo.toml index 172a0d3adf3..d5d1f0246b0 100644 --- a/components/plugins/Cargo.toml +++ b/components/plugins/Cargo.toml @@ -17,7 +17,7 @@ rev = "9dca15de3e8ea266d3e7e868c0f358ed4fa5f195" optional = true [dependencies] -url = "0.5.4" +url = {version = "0.5.4", features = ["heap_size"]} [features] default = [] diff --git a/components/plugins/heap_size.rs b/components/plugins/heap_size.rs deleted file mode 100644 index 0f8ea67fa62..00000000000 --- a/components/plugins/heap_size.rs +++ /dev/null @@ -1,82 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//! Handles the auto-deriving for `#[derive(HeapSizeOf)]` -//! -//! This provides the `#[derive(HeapSizeOf)]` decorator, which -//! generates a `HeapSizeOf` implementation that adds up -//! calls to heap_size_of_children() for all the fields -//! of a struct or enum variant. -//! -//! Fields marked `#[ignore_heap_size_of = "reason"]` will -//! be ignored in this calculation. Providing a reason is compulsory. - - -use syntax::ast::*; -use syntax::attr::AttrMetaMethods; -use syntax::codemap::Span; -use syntax::ext::base::{Annotatable, ExtCtxt}; -use syntax::ext::build::AstBuilder; -use syntax::ptr::P; -use syntax_ext::deriving::generic::*; - -pub fn expand_heap_size(cx: &mut ExtCtxt, span: Span, mitem: &MetaItem, - item: &Annotatable, push: &mut FnMut(Annotatable)) { - let trait_def = TraitDef { - is_unsafe: false, - span: span, - attributes: Vec::new(), - path: ty::Path::new(vec!("util", "mem", "HeapSizeOf")), - additional_bounds: Vec::new(), - generics: ty::LifetimeBounds::empty(), - methods: vec![ - MethodDef { - name: "heap_size_of_children", - generics: ty::LifetimeBounds::empty(), - explicit_self: ty::borrowed_explicit_self(), - args: vec!(), - ret_ty: ty::Literal(ty::Path::new_local("usize")), - attributes: vec!(), - is_unsafe: false, - combine_substructure: combine_substructure(Box::new(heap_size_substructure)) - } - ], - associated_types: vec![], - }; - trait_def.expand(cx, mitem, item, push) -} - -/// Defines how the implementation for `heap_size_of_children()` is to be generated. -fn heap_size_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure) -> P<Expr> { - let fields = match *substr.fields { - Struct(ref fs) | EnumMatching(_, _, ref fs) => fs, - _ => cx.span_bug(trait_span, "impossible substructure in `#[derive(HeapSizeOf)]`") - }; - - fields.iter().fold(cx.expr_usize(trait_span, 0), |acc, ref item| { - if item.attrs.iter() - .find(|ref a| { - if a.check_name("ignore_heap_size_of") { - match a.node.value.node { - MetaNameValue(..) => (), - _ => cx.span_err(a.span, "#[ignore_heap_size_of] \ - should have an explanation, \ - e.g. #[ignore_heap_size_of = \"\"]") - } - true - } else { - false - } - }) - .is_some() { - acc - } else { - cx.expr_binary(item.span, BiAdd, acc, - cx.expr_method_call(item.span, - item.self_.clone(), - substr.method_ident, - Vec::new())) - } - }) -} diff --git a/components/plugins/lib.rs b/components/plugins/lib.rs index b1d701e6aec..25181f2197c 100644 --- a/components/plugins/lib.rs +++ b/components/plugins/lib.rs @@ -36,8 +36,6 @@ use syntax::parse::token::intern; // Public for documentation to show up /// Handles the auto-deriving for `#[derive(JSTraceable)]` pub mod jstraceable; -/// Handles the auto-deriving for `#[derive(HeapSizeOf)]` -pub mod heap_size; pub mod lints; /// Autogenerates implementations of Reflectable on DOM structs pub mod reflector; @@ -51,7 +49,6 @@ pub fn plugin_registrar(reg: &mut Registry) { reg.register_syntax_extension(intern("dom_struct"), MultiModifier(box jstraceable::expand_dom_struct)); reg.register_syntax_extension(intern("derive_JSTraceable"), MultiDecorator(box jstraceable::expand_jstraceable)); reg.register_syntax_extension(intern("_generate_reflector"), MultiDecorator(box reflector::expand_reflector)); - reg.register_syntax_extension(intern("derive_HeapSizeOf"), MultiDecorator(box heap_size::expand_heap_size)); reg.register_macro("to_lower", casing::expand_lower); reg.register_macro("to_upper", casing::expand_upper); reg.register_macro("url", url_plugin::expand_url); diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml index 67cfdedae6a..b06ae8e8e48 100644 --- a/components/script/Cargo.toml +++ b/components/script/Cargo.toml @@ -64,27 +64,29 @@ path = "../gfx_traits" [dependencies] app_units = {version = "0.2", features = ["plugins"]} -cssparser = { version = "0.5", features = [ "serde-serialization" ] } -log = "0.3" +bitflags = "0.3" +caseless = "0.1.0" +cssparser = {version = "0.5.2", features = ["heap_size", "serde-serialization"]} encoding = "0.2" +euclid = {version = "0.6.1", features = ["plugins"]} fnv = "1.0" +heapsize = "0.2.5" +heapsize_plugin = "0.1.2" +html5ever = {version = "0.4.2", features = ["heap_size", "unstable"]} hyper = { version = "0.7", features = [ "serde-serialization" ] } -time = "0.1.12" -bitflags = "0.3" -rustc-serialize = "0.3" +image = "0.5.0" libc = "0.2" -unicase = "1.0" +log = "0.3" num = "0.1.24" -websocket = "0.14.0" -uuid = "0.1.16" -smallvec = "0.1" -html5ever = { version = "0.4", features = ["unstable"] } -selectors = "0.4.1" -string_cache = { version = "0.2", features = ["unstable"] } -euclid = {version = "0.6.1", features = ["plugins"]} rand = "0.3" -serde = "0.6" -caseless = "0.1.0" -image = "0.5.0" -url = "0.5.4" ref_slice = "0.1.0" +rustc-serialize = "0.3" +selectors = {version = "0.4.1", features = ["heap_size"]} +serde = "0.6" +smallvec = "0.1" +string_cache = {version = "0.2.7", features = ["heap_size", "unstable"]} +time = "0.1.12" +unicase = "1.0" +url = {version = "0.5.4", features = ["heap_size"]} +uuid = "0.1.16" +websocket = "0.14.0" diff --git a/components/script/cors.rs b/components/script/cors.rs index 7bf5127a22e..e64583e0a58 100644 --- a/components/script/cors.rs +++ b/components/script/cors.rs @@ -27,7 +27,6 @@ use std::sync::{Arc, Mutex}; use time::{self, Timespec, now}; use unicase::UniCase; use url::{SchemeData, Url}; -use util::mem::HeapSizeOf; use util::thread::spawn_named; /// Interface for network listeners concerned with CORS checks. Proper network requests @@ -41,6 +40,7 @@ pub struct CORSRequest { pub origin: Url, pub destination: Url, pub mode: RequestMode, + #[ignore_heap_size_of = "Defined in hyper"] pub method: Method, #[ignore_heap_size_of = "Defined in hyper"] pub headers: Headers, diff --git a/components/script/dom/bindings/error.rs b/components/script/dom/bindings/error.rs index 95f22e693e5..dafd14f58c9 100644 --- a/components/script/dom/bindings/error.rs +++ b/components/script/dom/bindings/error.rs @@ -14,7 +14,6 @@ use js::jsapi::{JSContext, JSObject, RootedValue}; use js::jsapi::{JS_IsExceptionPending, JS_ReportPendingException, JS_SetPendingException}; use js::jsapi::{JS_RestoreFrameChain, JS_SaveFrameChain}; use js::jsval::UndefinedValue; -use util::mem::HeapSizeOf; /// DOM exceptions that can be thrown by a native DOM method. #[derive(Debug, Clone, HeapSizeOf)] diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs index 6abf5f9b4e5..37d673f3c26 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -30,6 +30,7 @@ use dom::bindings::reflector::{Reflectable, Reflector}; use dom::bindings::trace::JSTraceable; use dom::bindings::trace::trace_reflector; use dom::node::Node; +use heapsize::HeapSizeOf; use js::jsapi::{Heap, JSObject, JSTracer}; use js::jsval::JSVal; use layout_interface::TrustedNodeAddress; @@ -40,7 +41,6 @@ use std::hash::{Hash, Hasher}; use std::mem; use std::ops::Deref; use std::ptr; -use util::mem::HeapSizeOf; use util::thread_state; /// A traced reference to a DOM object diff --git a/components/script/dom/bindings/str.rs b/components/script/dom/bindings/str.rs index df69bc77fd0..26c8568eadf 100644 --- a/components/script/dom/bindings/str.rs +++ b/components/script/dom/bindings/str.rs @@ -10,7 +10,6 @@ use std::hash::{Hash, Hasher}; use std::ops; use std::str; use std::str::FromStr; -use util::mem::HeapSizeOf; use util::str::is_token; /// Encapsulates the IDL `ByteString` type. diff --git a/components/script/dom/bindings/utils.rs b/components/script/dom/bindings/utils.rs index d34d8f3f9f4..83e7a2e4cb2 100644 --- a/components/script/dom/bindings/utils.rs +++ b/components/script/dom/bindings/utils.rs @@ -13,6 +13,7 @@ use dom::bindings::inheritance::TopTypeId; use dom::bindings::trace::trace_object; use dom::browsingcontext; use dom::window; +use heapsize::HeapSizeOf; use js; use js::error::throw_type_error; use js::glue::{CallJitGetterOp, CallJitMethodOp, CallJitSetterOp, IsWrapper}; @@ -36,7 +37,6 @@ use libc::{self, c_uint}; use std::default::Default; use std::ffi::CString; use std::ptr; -use util::mem::HeapSizeOf; use util::non_geckolib::jsstring_to_str; /// Proxy handler for a WindowProxy. diff --git a/components/script/dom/bindings/weakref.rs b/components/script/dom/bindings/weakref.rs index e311d4a40bb..99adb8a0c02 100644 --- a/components/script/dom/bindings/weakref.rs +++ b/components/script/dom/bindings/weakref.rs @@ -15,6 +15,7 @@ use core::nonzero::NonZero; use dom::bindings::js::Root; use dom::bindings::reflector::Reflectable; use dom::bindings::trace::JSTraceable; +use heapsize::HeapSizeOf; use js::jsapi::{JSTracer, JS_GetReservedSlot, JS_SetReservedSlot}; use js::jsval::PrivateValue; use libc::c_void; @@ -22,7 +23,6 @@ use std::cell::{Cell, UnsafeCell}; use std::iter::Iterator; use std::mem; use std::ops::{Deref, DerefMut, Drop}; -use util::mem::HeapSizeOf; /// The index of the slot wherein a pointer to the weak holder cell is /// stored for weak-referenceable bindings. We use slot 1 for holding it, diff --git a/components/script/dom/crypto.rs b/components/script/dom/crypto.rs index b8c595f3aa4..6e0351d37ee 100644 --- a/components/script/dom/crypto.rs +++ b/components/script/dom/crypto.rs @@ -20,6 +20,7 @@ no_jsmanaged_fields!(OsRng); #[dom_struct] pub struct Crypto { reflector_: Reflector, + #[ignore_heap_size_of = "Defined in rand"] rng: DOMRefCell<OsRng>, } diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index d093380b008..3cdf3f6ba43 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -84,7 +84,6 @@ use style::properties::{PropertyDeclaration, PropertyDeclarationBlock, parse_sty use style::selector_impl::{NonTSPseudoClass, ServoSelectorImpl}; use style::values::CSSFloat; use style::values::specified::{self, CSSColor, CSSRGBA, LengthOrPercentage}; -use util::mem::HeapSizeOf; use util::str::{DOMString, LengthOrPercentageOrAuto}; // TODO: Update focus state when the top-level browsing context gains or loses system focus, diff --git a/components/script/dom/eventtarget.rs b/components/script/dom/eventtarget.rs index 48682ec2211..2cf9517d606 100644 --- a/components/script/dom/eventtarget.rs +++ b/components/script/dom/eventtarget.rs @@ -21,6 +21,7 @@ use dom::eventdispatcher::dispatch_event; use dom::virtualmethods::VirtualMethods; use dom::window::Window; use fnv::FnvHasher; +use heapsize::HeapSizeOf; use js::jsapi::{CompileFunction, JS_GetFunctionObject, RootedValue}; use js::jsapi::{HandleObject, JSContext, RootedFunction}; use js::jsapi::{JSAutoCompartment, JSAutoRequest}; @@ -35,7 +36,6 @@ use std::rc::Rc; use std::{intrinsics, ptr}; use string_cache::Atom; use url::Url; -use util::mem::HeapSizeOf; use util::str::DOMString; #[derive(PartialEq, Clone, JSTraceable)] diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 9c4e52b495d..a50aad1a78e 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -9,7 +9,6 @@ use core::nonzero::NonZero; use devtools_traits::NodeInfo; use document_loader::DocumentLoader; use dom::attr::Attr; -use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::AttrBinding::AttrMethods; use dom::bindings::codegen::Bindings::CharacterDataBinding::CharacterDataMethods; use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; @@ -47,6 +46,7 @@ use dom::text::Text; use dom::virtualmethods::{VirtualMethods, vtable_for}; use dom::window::Window; use euclid::rect::Rect; +use heapsize::{HeapSizeOf, heap_size_of}; use js::jsapi::{JSContext, JSObject, JSRuntime}; use layout_interface::{LayoutChan, Msg}; use libc::{self, c_void, uintptr_t}; @@ -57,7 +57,7 @@ use selectors::matching::matches; use selectors::parser::Selector; use selectors::parser::parse_author_origin_selector_list_from_str; use std::borrow::ToOwned; -use std::cell::Cell; +use std::cell::{Cell, UnsafeCell}; use std::cmp::max; use std::default::Default; use std::iter::{self, FilterMap, Peekable}; @@ -120,7 +120,7 @@ pub struct Node { /// node is finalized. style_and_layout_data: Cell<Option<OpaqueStyleAndLayoutData>>, - unique_id: DOMRefCell<Option<Box<Uuid>>>, + unique_id: UniqueId, } bitflags! { @@ -755,11 +755,7 @@ impl Node { } pub fn get_unique_id(&self) -> String { - if self.unique_id.borrow().is_none() { - let mut unique_id = self.unique_id.borrow_mut(); - *unique_id = Some(Box::new(Uuid::new_v4())); - } - self.unique_id.borrow().as_ref().unwrap().to_simple_string() + self.unique_id.borrow().to_simple_string() } pub fn summarize(&self) -> NodeInfo { @@ -1266,7 +1262,7 @@ impl Node { style_and_layout_data: Cell::new(None), - unique_id: DOMRefCell::new(None), + unique_id: UniqueId::new(), } } @@ -2438,3 +2434,40 @@ impl<'a> UnbindContext<'a> { index } } + +/// A node's unique ID, for devtools. +struct UniqueId { + cell: UnsafeCell<Option<Box<Uuid>>>, +} + +no_jsmanaged_fields!(UniqueId); + +impl HeapSizeOf for UniqueId { + #[allow(unsafe_code)] + fn heap_size_of_children(&self) -> usize { + if let &Some(ref uuid) = unsafe { &*self.cell.get() } { + heap_size_of(&** uuid as *const Uuid as *const c_void) + } else { + 0 + } + } +} + +impl UniqueId { + /// Create a new `UniqueId` value. The underlying `Uuid` is lazily created. + fn new() -> UniqueId { + UniqueId { cell: UnsafeCell::new(None) } + } + + /// The Uuid of that unique ID. + #[allow(unsafe_code)] + fn borrow(&self) -> &Uuid { + unsafe { + let ptr = self.cell.get(); + if (*ptr).is_none() { + *ptr = Some(box Uuid::new_v4()); + } + &(&*ptr).as_ref().unwrap() + } + } +} diff --git a/components/script/dom/range.rs b/components/script/dom/range.rs index 03db51ba0d8..6807a7a2d3c 100644 --- a/components/script/dom/range.rs +++ b/components/script/dom/range.rs @@ -23,10 +23,10 @@ use dom::document::Document; use dom::documentfragment::DocumentFragment; use dom::node::{Node, UnbindContext}; use dom::text::Text; +use heapsize::HeapSizeOf; use js::jsapi::JSTracer; use std::cell::{Cell, UnsafeCell}; use std::cmp::{Ord, Ordering, PartialEq, PartialOrd}; -use util::mem::HeapSizeOf; use util::str::DOMString; #[dom_struct] diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index e6b7374ef39..59feddfcc22 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -62,7 +62,6 @@ use string_cache::Atom; use time; use timers::{ScheduledCallback, TimerHandle}; use url::Url; -use util::mem::HeapSizeOf; use util::str::DOMString; pub type SendParam = BlobOrStringOrURLSearchParams; @@ -127,11 +126,13 @@ pub struct XMLHttpRequest { response_xml: MutNullableHeap<JS<Document>>, #[ignore_heap_size_of = "Defined in hyper"] response_headers: DOMRefCell<Headers>, + #[ignore_heap_size_of = "Defined in hyper"] override_mime_type: DOMRefCell<Option<Mime>>, #[ignore_heap_size_of = "Defined in rust-encoding"] override_charset: DOMRefCell<Option<EncodingRef>>, // Associated concepts + #[ignore_heap_size_of = "Defined in hyper"] request_method: DOMRefCell<Method>, request_url: DOMRefCell<Option<Url>>, #[ignore_heap_size_of = "Defined in hyper"] diff --git a/components/script/lib.rs b/components/script/lib.rs index 6365c03c5b7..b857a00e122 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -26,6 +26,7 @@ #![doc = "The script crate contains all matters DOM."] +#![plugin(heapsize_plugin)] #![plugin(plugins)] extern crate angle; @@ -42,6 +43,7 @@ extern crate encoding; extern crate euclid; extern crate fnv; extern crate gfx_traits; +extern crate heapsize; extern crate html5ever; extern crate hyper; extern crate image; diff --git a/components/script/mem.rs b/components/script/mem.rs index 113f03b8396..e276b1a5c3d 100644 --- a/components/script/mem.rs +++ b/components/script/mem.rs @@ -6,8 +6,8 @@ use dom::bindings::conversions::get_dom_class; use dom::bindings::reflector::Reflectable; +use heapsize::{HeapSizeOf, heap_size_of}; use libc::c_void; -use util::mem::{HeapSizeOf, heap_size_of}; // This is equivalent to measuring a Box<T>, except that DOM objects lose their // associated box in order to stash their pointers in a reserved slot of their diff --git a/components/script/textinput.rs b/components/script/textinput.rs index 5d533f0e419..02fb79e04a8 100644 --- a/components/script/textinput.rs +++ b/components/script/textinput.rs @@ -12,7 +12,6 @@ use std::borrow::ToOwned; use std::cmp::{max, min}; use std::default::Default; use std::usize; -use util::mem::HeapSizeOf; use util::str::DOMString; #[derive(Copy, Clone, PartialEq)] diff --git a/components/script/timers.rs b/components/script/timers.rs index 7f608f98f46..1c1157d30ae 100644 --- a/components/script/timers.rs +++ b/components/script/timers.rs @@ -9,6 +9,7 @@ use dom::bindings::reflector::Reflectable; use dom::bindings::trace::JSTraceable; use dom::window::ScriptHelpers; use euclid::length::Length; +use heapsize::HeapSizeOf; use ipc_channel::ipc::IpcSender; use js::jsapi::{HandleValue, Heap, RootedValue}; use js::jsval::{JSVal, UndefinedValue}; @@ -19,7 +20,6 @@ use std::cell::Cell; use std::cmp::{self, Ord, Ordering}; use std::default::Default; use std::rc::Rc; -use util::mem::HeapSizeOf; use util::str::DOMString; #[derive(JSTraceable, PartialEq, Eq, Copy, Clone, HeapSizeOf, Hash, PartialOrd, Ord, Debug)] diff --git a/components/script_traits/Cargo.toml b/components/script_traits/Cargo.toml index 5b3f25aa6fa..8644762b7db 100644 --- a/components/script_traits/Cargo.toml +++ b/components/script_traits/Cargo.toml @@ -42,9 +42,11 @@ git = "https://github.com/servo/ipc-channel" [dependencies] app_units = {version = "0.2", features = ["plugins"]} -libc = "0.2" euclid = {version = "0.6.1", features = ["plugins"]} +heapsize = "0.2.5" +heapsize_plugin = "0.1.2" +libc = "0.2" serde = "0.6" serde_macros = "0.6" time = "0.1.12" -url = "0.5.4" +url = {version = "0.5.4", features = ["heap_size"]} diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index 9229c626ab6..83761f20090 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -7,7 +7,7 @@ //! to depend on script. #![feature(custom_derive, plugin)] -#![plugin(plugins, serde_macros)] +#![plugin(heapsize_plugin, plugins, serde_macros)] #![deny(missing_docs)] extern crate app_units; @@ -15,6 +15,7 @@ extern crate canvas_traits; extern crate devtools_traits; extern crate euclid; extern crate gfx_traits; +extern crate heapsize; extern crate ipc_channel; extern crate libc; extern crate msg; @@ -50,7 +51,6 @@ use profile_traits::mem; use std::any::Any; use url::Url; use util::ipc::OptionalOpaqueIpcSender; -use util::mem::HeapSizeOf; pub use script_msg::{LayoutMsg, ScriptMsg}; diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index 741c2982de1..f78d15b3b1b 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -80,7 +80,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "heapsize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -102,7 +102,7 @@ dependencies = [ "core-text 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "freetype 0.1.0 (git+https://github.com/servo/rust-freetype)", - "heapsize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -167,9 +167,11 @@ name = "canvas_traits" version = "0.0.1" dependencies = [ "azure 0.4.0 (git+https://github.com/servo/rust-azure)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_traits 0.0.1", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", "layers 0.2.1 (git+https://github.com/servo/rust-layers)", "offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)", @@ -347,10 +349,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cssparser" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -391,6 +395,8 @@ name = "devtools_traits" version = "0.0.1" dependencies = [ "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", "msg 0.0.1", @@ -540,7 +546,7 @@ name = "euclid" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "heapsize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", @@ -647,6 +653,8 @@ dependencies = [ "freetype 0.1.0 (git+https://github.com/servo/rust-freetype)", "gfx_traits 0.0.1", "harfbuzz-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", "layers 0.2.1 (git+https://github.com/servo/rust-layers)", "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", @@ -665,7 +673,7 @@ dependencies = [ "servo-skia 0.20130412.6 (registry+https://github.com/rust-lang/crates.io-index)", "simd 0.1.0 (git+https://github.com/huonw/simd)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "style 0.0.1", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -688,6 +696,8 @@ version = "0.0.1" dependencies = [ "azure 0.4.0 (git+https://github.com/servo/rust-azure)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "layers 0.2.1 (git+https://github.com/servo/rust-layers)", "msg 0.0.1", "plugins 0.0.1", @@ -797,7 +807,7 @@ dependencies = [ [[package]] name = "heapsize" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -818,15 +828,17 @@ dependencies = [ [[package]] name = "html5ever" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "phf 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -918,7 +930,7 @@ name = "js" version = "0.1.1" source = "git+https://github.com/servo/rust-mozjs#b96675b217534c7742cbfda8150ea0536aedbdfb" dependencies = [ - "heapsize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "mozjs_sys 0.0.0 (git+https://github.com/servo/mozjs)", @@ -956,7 +968,7 @@ dependencies = [ "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "glx 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "heapsize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "io-surface 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -976,11 +988,13 @@ dependencies = [ "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "canvas 0.0.1", "canvas_traits 0.0.1", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "gfx 0.0.1", "gfx_traits 0.0.1", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", "layout_traits 0.0.1", "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -997,7 +1011,7 @@ dependencies = [ "serde_json 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "style 0.0.1", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-bidi 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1167,8 +1181,10 @@ name = "msg" version = "0.0.1" dependencies = [ "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", "layers 0.2.1 (git+https://github.com/servo/rust-layers)", @@ -1239,6 +1255,8 @@ dependencies = [ name = "net_traits" version = "0.0.1" dependencies = [ + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", @@ -1549,13 +1567,15 @@ dependencies = [ "canvas 0.0.1", "canvas_traits 0.0.1", "caseless 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "devtools_traits 0.0.1", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_traits 0.0.1", - "html5ever 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", @@ -1575,7 +1595,7 @@ dependencies = [ "selectors 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "style 0.0.1", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1604,6 +1624,8 @@ dependencies = [ "devtools_traits 0.0.1", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_traits 0.0.1", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", @@ -1625,12 +1647,14 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "quickersort 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1798,10 +1822,12 @@ dependencies = [ [[package]] name = "string_cache" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "debug_unreachable 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "phf_generator 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "phf_shared 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1814,10 +1840,12 @@ version = "0.0.1" dependencies = [ "app_units 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1828,7 +1856,7 @@ dependencies = [ "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "style_traits 0.0.1", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1840,12 +1868,12 @@ name = "style_tests" version = "0.0.1" dependencies = [ "app_units 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", "plugins 0.0.1", "selectors 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "style 0.0.1", "style_traits 0.0.1", "url 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1856,8 +1884,10 @@ dependencies = [ name = "style_traits" version = "0.0.1" dependencies = [ - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1972,6 +2002,8 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2004,10 +2036,12 @@ dependencies = [ "app_units 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "azure 0.4.0 (git+https://github.com/servo/rust-azure)", "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", - "html5ever 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", "js 0.1.1 (git+https://github.com/servo/rust-mozjs)", @@ -2025,7 +2059,7 @@ dependencies = [ "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2209,7 +2243,7 @@ dependencies = [ "phf 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/components/servo/Cargo.toml b/components/servo/Cargo.toml index 7e4f3cc8151..1b0a92ff94e 100644 --- a/components/servo/Cargo.toml +++ b/components/servo/Cargo.toml @@ -163,8 +163,8 @@ version = "0.2" git = "https://github.com/ecoal95/rust-offscreen-rendering-context" [dependencies] -env_logger = "0.3" bitflags = "0.3" -libc = "0.2" -url = {version = "0.5.4", features = ["serde_serialization", "query_encoding"]} +env_logger = "0.3" euclid = {version = "0.6.1", features = ["plugins"]} +libc = "0.2" +url = {version = "0.5.4", features = ["heap_size", "serde_serialization", "query_encoding"]} diff --git a/components/style/Cargo.toml b/components/style/Cargo.toml index 60477f39602..85a300d17d6 100644 --- a/components/style/Cargo.toml +++ b/components/style/Cargo.toml @@ -20,21 +20,23 @@ path = "../style_traits" [dependencies] app_units = {version = "0.2", features = ["plugins"]} -cssparser = { version = "0.5", features = [ "serde-serialization" ] } +cssparser = {version = "0.5.2", features = ["heap_size", "serde-serialization"]} log = "0.3" encoding = "0.2" fnv = "1.0" +heapsize = "0.2.5" +heapsize_plugin = "0.1.2" rustc-serialize = "0.3" matches = "0.1" bitflags = "0.3" num = "0.1.24" lazy_static = "0.1.10" -selectors = { version = "0.4.1", features = ["unstable"] } +selectors = {version = "0.4.1", features = ["heap_size", "unstable"]} smallvec = "0.1" -string_cache = "0.2" +string_cache = {version = "0.2.7", features = ["heap_size"]} euclid = {version = "0.6.1", features = ["plugins"]} serde = "0.6" serde_macros = "0.6" time = "0.1" -url = "0.5.4" +url = {version = "0.5.4", features = ["heap_size"]} diff --git a/components/style/custom_properties.rs b/components/style/custom_properties.rs index af9a2c4e7da..26fc794afb3 100644 --- a/components/style/custom_properties.rs +++ b/components/style/custom_properties.rs @@ -10,7 +10,6 @@ use std::collections::{HashMap, HashSet}; use std::fmt; use std::sync::Arc; use string_cache::Atom; -use util::mem::HeapSizeOf; // Does not include the `--` prefix pub type Name = Atom; diff --git a/components/style/font_face.rs b/components/style/font_face.rs index d42e0feb3e9..0810afac5a8 100644 --- a/components/style/font_face.rs +++ b/components/style/font_face.rs @@ -8,7 +8,6 @@ use parser::{ParserContext, log_css_error}; use properties::longhands::font_family::parse_one_family; use std::ascii::AsciiExt; use url::Url; -use util::mem::HeapSizeOf; #[derive(Clone, Debug, HeapSizeOf, PartialEq, Eq, Deserialize, Serialize)] pub enum Source { diff --git a/components/style/lib.rs b/components/style/lib.rs index dee1d51efc6..6dbb7250ffc 100644 --- a/components/style/lib.rs +++ b/components/style/lib.rs @@ -11,9 +11,9 @@ #![feature(custom_derive)] #![feature(plugin)] -#![plugin(serde_macros)] -#![plugin(serde_macros)] +#![plugin(heapsize_plugin)] #![plugin(plugins)] +#![plugin(serde_macros)] #![recursion_limit = "500"] // For match_ignore_ascii_case in PropertyDeclaration::parse @@ -26,6 +26,7 @@ extern crate cssparser; extern crate encoding; extern crate euclid; extern crate fnv; +extern crate heapsize; #[macro_use] extern crate lazy_static; #[macro_use] diff --git a/components/style/media_queries.rs b/components/style/media_queries.rs index 82b02cc9701..b19b4d81c7e 100644 --- a/components/style/media_queries.rs +++ b/components/style/media_queries.rs @@ -8,7 +8,6 @@ use euclid::size::{Size2D, TypedSize2D}; use properties::longhands; use std::ascii::AsciiExt; use util::geometry::ViewportPx; -use util::mem::HeapSizeOf; use values::specified; diff --git a/components/style/stylesheets.rs b/components/style/stylesheets.rs index ce21cf68522..bc4008040c2 100644 --- a/components/style/stylesheets.rs +++ b/components/style/stylesheets.rs @@ -19,7 +19,6 @@ use std::iter::Iterator; use std::slice; use string_cache::{Atom, Namespace}; use url::Url; -use util::mem::HeapSizeOf; use viewport::ViewportRule; diff --git a/components/style/viewport.rs b/components/style/viewport.rs index e46d22c19b1..f50a2a5fb2b 100644 --- a/components/style/viewport.rs +++ b/components/style/viewport.rs @@ -18,7 +18,6 @@ use std::str::Chars; use style_traits::viewport::{Orientation, UserZoom, ViewportConstraints, Zoom}; use stylesheets::Origin; use util::geometry::ViewportPx; -use util::mem::HeapSizeOf; use values::computed::{Context, ToComputedValue}; use values::specified::{Length, LengthOrPercentageOrAuto, ViewportPercentageLength}; diff --git a/components/style_traits/Cargo.toml b/components/style_traits/Cargo.toml index 302ac6d8076..4d4ce440488 100644 --- a/components/style_traits/Cargo.toml +++ b/components/style_traits/Cargo.toml @@ -14,14 +14,15 @@ path = "../util" path = "../plugins" [dependencies] -cssparser = { version = "0.5", features = [ "serde-serialization" ] } +cssparser = {version = "0.5.2", features = ["heap_size", "serde-serialization"]} euclid = {version = "0.6.1", features = ["plugins"]} -log = "0.3" +heapsize = "0.2.5" +heapsize_plugin = "0.1.2" lazy_static = "0.1.10" +log = "0.3" num = "0.1.24" rustc-serialize = "0.3" -selectors = "0.4.1" +selectors = {version = "0.4.1", features = ["heap_size"]} serde = "0.6" serde_macros = "0.6" -url = "0.5.4" - +url = {version = "0.5.4", features = ["heap_size"]} diff --git a/components/style_traits/lib.rs b/components/style_traits/lib.rs index 5a56874514d..9e65308207e 100644 --- a/components/style_traits/lib.rs +++ b/components/style_traits/lib.rs @@ -10,6 +10,7 @@ #![crate_type = "rlib"] #![feature(custom_derive)] #![feature(plugin)] +#![plugin(heapsize_plugin)] #![plugin(serde_macros)] #![plugin(plugins)] #![deny(unsafe_code)] @@ -17,6 +18,7 @@ #[macro_use] extern crate cssparser; extern crate euclid; +extern crate heapsize; extern crate rustc_serialize; extern crate serde; extern crate util; diff --git a/components/util/Cargo.toml b/components/util/Cargo.toml index 78a12b029ef..6d5ef0714a8 100644 --- a/components/util/Cargo.toml +++ b/components/util/Cargo.toml @@ -46,25 +46,27 @@ git = "https://github.com/servo/ipc-channel" [dependencies] app_units = {version = "0.2", features = ["plugins"]} -cssparser = { version = "0.5", features = [ "serde-serialization" ] } -log = "0.3" bitflags = "0.3" -html5ever = { version = "0.4", features = ["unstable"], optional = true } +cssparser = {version = "0.5.2", features = ["heap_size", "serde-serialization"]} +euclid = {version = "0.6.1", features = ["unstable", "plugins"]} +getopts = "0.2.11" +html5ever = {version = "0.4.2", features = ["heap_size", "unstable"], optional = true} +heapsize = "0.2.5" +heapsize_plugin = "0.1.2" +hyper = { version = "0.7", optional = true } +lazy_static = "0.1" libc = "0.2" +log = "0.3" +num = "0.1.24" +num_cpus = "0.2.2" rand = "0.3" rustc-serialize = "0.3" -smallvec = "0.1" -num_cpus = "0.2.2" -num = "0.1.24" -euclid = {version = "0.6.1", features = ["unstable", "plugins"]} -selectors = "0.4.1" +selectors = {version = "0.4.1", features = ["heap_size"]} serde = "0.6" serde_macros = "0.6" -string_cache = "0.2" -lazy_static = "0.1" -getopts = "0.2.11" -hyper = { version = "0.7", optional = true } -url = {version = "0.5.4", features = ["serde_serialization"]} +smallvec = "0.1" +string_cache = {version = "0.2.7", features = ["heap_size"]} +url = {version = "0.5.4", features = ["heap_size", "serde_serialization"]} uuid = "0.1.17" [target.x86_64-pc-windows-gnu.dependencies] diff --git a/components/util/cursor.rs b/components/util/cursor.rs index fa7ceb413c6..7f139fd498e 100644 --- a/components/util/cursor.rs +++ b/components/util/cursor.rs @@ -9,7 +9,7 @@ use std::ascii::AsciiExt; macro_rules! define_cursor { ($( $css: expr => $variant: ident = $value: expr, )+) => { - #[derive(Clone, Copy, PartialEq, Eq, Debug, Deserialize, Serialize)] + #[derive(Clone, Copy, Debug, Deserialize, Eq, HeapSizeOf, PartialEq, Serialize)] #[repr(u8)] pub enum Cursor { $( $variant = $value ),+ diff --git a/components/util/geometry.rs b/components/util/geometry.rs index 4af85d703c9..813cad3aa3d 100644 --- a/components/util/geometry.rs +++ b/components/util/geometry.rs @@ -23,7 +23,7 @@ use std::i32; /// /// The ratio between ScreenPx and DevicePixel for a given display be found by calling /// `servo::windowing::WindowMethods::hidpi_factor`. -#[derive(Debug, Copy, Clone)] +#[derive(Clone, Copy, Debug, HeapSizeOf)] pub enum ScreenPx {} /// One CSS "px" in the coordinate system of the "initial viewport": @@ -35,7 +35,7 @@ pub enum ScreenPx {} /// /// At the default zoom level of 100%, one PagePx is equal to one ScreenPx. However, if the /// document is zoomed in or out then this scale may be larger or smaller. -#[derive(RustcEncodable, Debug, Copy, Clone)] +#[derive(Clone, Copy, Debug, HeapSizeOf)] pub enum ViewportPx {} /// One CSS "px" in the root coordinate system for the content document. @@ -44,7 +44,7 @@ pub enum ViewportPx {} /// This is the mobile-style "pinch zoom" that enlarges content without reflowing it. When the /// viewport zoom is not equal to 1.0, then the layout viewport is no longer the same physical size /// as the viewable area. -#[derive(RustcEncodable, Debug, Copy, Clone)] +#[derive(Clone, Copy, Debug, HeapSizeOf)] pub enum PagePx {} // In summary, the hierarchy of pixel units and the factors to convert from one to the next: diff --git a/components/util/lib.rs b/components/util/lib.rs index 660945d4c1a..61d99cb5a02 100644 --- a/components/util/lib.rs +++ b/components/util/lib.rs @@ -18,7 +18,7 @@ #![feature(step_trait)] #![feature(zero_one)] -#![plugin(plugins, serde_macros)] +#![plugin(heapsize_plugin, plugins, serde_macros)] extern crate alloc; extern crate app_units; @@ -30,6 +30,7 @@ extern crate bitflags; extern crate cssparser; extern crate euclid; extern crate getopts; +extern crate heapsize; #[cfg(feature = "non-geckolib")] extern crate html5ever; #[cfg(feature = "non-geckolib")] @@ -66,7 +67,6 @@ pub mod geometry; pub mod ipc; pub mod linked_list; pub mod logical_geometry; -#[macro_use] pub mod mem; #[cfg(feature = "non-geckolib")] pub mod non_geckolib; pub mod opts; diff --git a/components/util/logical_geometry.rs b/components/util/logical_geometry.rs index 0c4372ce7f2..661ef0c6a65 100644 --- a/components/util/logical_geometry.rs +++ b/components/util/logical_geometry.rs @@ -11,7 +11,7 @@ use std::fmt::{self, Debug, Error, Formatter}; use std::ops::{Add, Sub}; bitflags!( - #[derive(RustcEncodable)] + #[derive(HeapSizeOf, RustcEncodable)] flags WritingMode: u8 { const FLAG_RTL = 1 << 0, const FLAG_VERTICAL = 1 << 1, diff --git a/components/util/mem.rs b/components/util/mem.rs deleted file mode 100644 index b5654b24123..00000000000 --- a/components/util/mem.rs +++ /dev/null @@ -1,360 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//! Data structure measurement. - -use app_units::Au; -use cssparser::Color as CSSParserColor; -use cssparser::{RGBA, TokenSerializationType}; -use cursor::Cursor; -use euclid::length::Length; -use euclid::scale_factor::ScaleFactor; -use euclid::{Matrix2D, Matrix4, Point2D, Rect, SideOffsets2D, Size2D}; -use geometry::{PagePx, ViewportPx}; -use libc::{c_void, size_t}; -use logical_geometry::WritingMode; -use rand::OsRng; -use range::Range; -use selectors::parser::{Combinator, CompoundSelector, Selector, SimpleSelector, SelectorImpl}; -use std::cell::{Cell, RefCell}; -use std::collections::{HashMap, LinkedList}; -use std::hash::{BuildHasher, Hash}; -use std::mem::{size_of, transmute}; -use std::rc::Rc; -use std::result::Result; -use std::sync::Arc; -use std::sync::atomic::{AtomicIsize, AtomicUsize}; -use str::{DOMString, LengthOrPercentageOrAuto}; -use string_cache::atom::Atom; -use string_cache::namespace::{QualName, Namespace}; -use url; -use uuid::Uuid; - -extern { - // Get the size of a heap block. - // - // Ideally Rust would expose a function like this in std::rt::heap, which would avoid the - // jemalloc dependence. - // - // The C prototype is `je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void *ptr)`. On some - // platforms `JEMALLOC_USABLE_SIZE_CONST` is `const` and on some it is empty. But in practice - // this function doesn't modify the contents of the block that `ptr` points to, so we use - // `*const c_void` here. - fn je_malloc_usable_size(ptr: *const c_void) -> size_t; -} - -// A wrapper for je_malloc_usable_size that handles `EMPTY` and returns `usize`. -pub fn heap_size_of(ptr: *const c_void) -> usize { - if ptr == ::alloc::heap::EMPTY as *const c_void { - 0 - } else { - unsafe { je_malloc_usable_size(ptr) as usize } - } -} - -// The simplest trait for measuring the size of heap data structures. More complex traits that -// return multiple measurements -- e.g. measure text separately from images -- are also possible, -// and should be used when appropriate. -// -pub trait HeapSizeOf { - /// Measure the size of any heap-allocated structures that hang off this value, but not the - /// space taken up by the value itself (i.e. what size_of::<T> measures, more or less); that - /// space is handled by the implementation of HeapSizeOf for Box<T> below. - fn heap_size_of_children(&self) -> usize; -} - -// There are two possible ways to measure the size of `self` when it's on the heap: compute it -// (with `::std::rt::heap::usable_size(::std::mem::size_of::<T>(), 0)`) or measure it directly -// using the heap allocator (with `heap_size_of`). We do the latter, for the following reasons. -// -// * The heap allocator is the true authority for the sizes of heap blocks; its measurement is -// guaranteed to be correct. In comparison, size computations are error-prone. (For example, the -// `rt::heap::usable_size` function used in some of Rust's non-default allocator implementations -// underestimate the true usable size of heap blocks, which is safe in general but would cause -// under-measurement here.) -// -// * If we measure something that isn't a heap block, we'll get a crash. This keeps us honest, -// which is important because unsafe code is involved and this can be gotten wrong. -// -// However, in the best case, the two approaches should give the same results. -// -impl<T: HeapSizeOf> HeapSizeOf for Box<T> { - fn heap_size_of_children(&self) -> usize { - // Measure size of `self`. - heap_size_of(&**self as *const T as *const c_void) + (**self).heap_size_of_children() - } -} - -impl HeapSizeOf for String { - fn heap_size_of_children(&self) -> usize { - heap_size_of(self.as_ptr() as *const c_void) - } -} - -impl HeapSizeOf for DOMString { - fn heap_size_of_children(&self) -> usize { - heap_size_of(self.as_ptr() as *const c_void) - } -} - -impl<T: HeapSizeOf> HeapSizeOf for Option<T> { - fn heap_size_of_children(&self) -> usize { - match *self { - None => 0, - Some(ref x) => x.heap_size_of_children() - } - } -} - -impl HeapSizeOf for url::Url { - fn heap_size_of_children(&self) -> usize { - // Using a struct pattern without `..` rather than `foo.bar` field access - // makes sure this will be updated if a field is added. - let &url::Url { ref scheme, ref scheme_data, ref query, ref fragment } = self; - scheme.heap_size_of_children() + - scheme_data.heap_size_of_children() + - query.heap_size_of_children() + - fragment.heap_size_of_children() - } -} - -impl HeapSizeOf for url::SchemeData { - fn heap_size_of_children(&self) -> usize { - match *self { - url::SchemeData::Relative(ref data) => data.heap_size_of_children(), - url::SchemeData::NonRelative(ref str) => str.heap_size_of_children() - } - } -} - -impl HeapSizeOf for url::RelativeSchemeData { - fn heap_size_of_children(&self) -> usize { - // Using a struct pattern without `..` rather than `foo.bar` field access - // makes sure this will be updated if a field is added. - let &url::RelativeSchemeData { ref username, ref password, ref host, - ref port, ref default_port, ref path } = self; - username.heap_size_of_children() + - password.heap_size_of_children() + - host.heap_size_of_children() + - port.heap_size_of_children() + - default_port.heap_size_of_children() + - path.heap_size_of_children() - } -} - -impl HeapSizeOf for url::Host { - fn heap_size_of_children(&self) -> usize { - match *self { - url::Host::Domain(ref str) => str.heap_size_of_children(), - url::Host::Ipv6(_) => 0, - url::Host::Ipv4(_) => 0, - } - } -} - -impl<T: HeapSizeOf, U: HeapSizeOf> HeapSizeOf for (T, U) { - fn heap_size_of_children(&self) -> usize { - self.0.heap_size_of_children() + self.1.heap_size_of_children() - } -} - -impl<T: HeapSizeOf> HeapSizeOf for Arc<T> { - fn heap_size_of_children(&self) -> usize { - (**self).heap_size_of_children() - } -} - -impl<T: HeapSizeOf> HeapSizeOf for RefCell<T> { - fn heap_size_of_children(&self) -> usize { - self.borrow().heap_size_of_children() - } -} - -impl<T: HeapSizeOf + Copy> HeapSizeOf for Cell<T> { - fn heap_size_of_children(&self) -> usize { - self.get().heap_size_of_children() - } -} - -impl<T: HeapSizeOf> HeapSizeOf for Vec<T> { - fn heap_size_of_children(&self) -> usize { - heap_size_of(self.as_ptr() as *const c_void) + - self.iter().fold(0, |n, elem| n + elem.heap_size_of_children()) - } -} - -impl<T> HeapSizeOf for Vec<Rc<T>> { - fn heap_size_of_children(&self) -> usize { - // The fate of measuring Rc<T> is still undecided, but we still want to measure - // the space used for storing them. - heap_size_of(self.as_ptr() as *const c_void) - } -} - -impl<K: HeapSizeOf, V: HeapSizeOf, S> HeapSizeOf for HashMap<K, V, S> - where K: Eq + Hash, S: BuildHasher { - fn heap_size_of_children(&self) -> usize { - //TODO(#6908) measure actual bucket memory usage instead of approximating - let size = self.capacity() * (size_of::<V>() + size_of::<K>()); - self.iter().fold(size, |n, (key, value)| { - n + key.heap_size_of_children() + value.heap_size_of_children() - }) - } -} - -// FIXME(njn): We can't implement HeapSizeOf accurately for LinkedList because it requires access -// to the private Node type. Eventually we'll want to add HeapSizeOf (or equivalent) to Rust -// itself. In the meantime, we use the dirty hack of transmuting LinkedList into an identical type -// (LinkedList2) and measuring that. -impl<T: HeapSizeOf> HeapSizeOf for LinkedList<T> { - fn heap_size_of_children(&self) -> usize { - let list2: &LinkedList2<T> = unsafe { transmute(self) }; - list2.heap_size_of_children() - } -} - -struct LinkedList2<T> { - _length: usize, - list_head: Link<T>, - _list_tail: Rawlink<Node<T>>, -} - -type Link<T> = Option<Box<Node<T>>>; - -struct Rawlink<T> { - _p: *mut T, -} - -struct Node<T> { - next: Link<T>, - _prev: Rawlink<Node<T>>, - value: T, -} - -impl<T: HeapSizeOf> HeapSizeOf for Node<T> { - // Unlike most heap_size_of_children() functions, this one does *not* measure descendents. - // Instead, LinkedList2<T>::heap_size_of_children() handles that, so that it can use iteration - // instead of recursion, which avoids potentially blowing the stack. - fn heap_size_of_children(&self) -> usize { - self.value.heap_size_of_children() - } -} - -impl<T: HeapSizeOf> HeapSizeOf for LinkedList2<T> { - fn heap_size_of_children(&self) -> usize { - let mut size = 0; - let mut curr: &Link<T> = &self.list_head; - while curr.is_some() { - size += (*curr).heap_size_of_children(); - curr = &curr.as_ref().unwrap().next; - } - size - } -} - -// This is a basic sanity check. If the representation of LinkedList changes such that it becomes a -// different size to LinkedList2, this will fail at compile-time. -#[allow(dead_code)] -unsafe fn linked_list2_check() { - transmute::<LinkedList<i32>, LinkedList2<i32>>(panic!()); -} - -// Currently, types that implement the Drop type are larger than those that don't. Because -// LinkedList implements Drop, LinkedList2 must also so that linked_list2_check() doesn't fail. -impl<T> Drop for LinkedList2<T> { - fn drop(&mut self) {} -} - -/// For use on types defined in external crates -/// with known heap sizes. -#[macro_export] -macro_rules! known_heap_size( - ($size:expr, $($ty:ident),+) => ( - $( - impl $crate::mem::HeapSizeOf for $ty { - #[inline(always)] - fn heap_size_of_children(&self) -> usize { - $size - } - } - )+ - ); - ($size: expr, $($ty:ident<$($gen:ident),+>),+) => ( - $( - impl<$($gen: $crate::mem::HeapSizeOf),+> $crate::mem::HeapSizeOf for $ty<$($gen),+> { - #[inline(always)] - fn heap_size_of_children(&self) -> usize { - $size - } - } - )+ - ); -); - -impl<T: HeapSizeOf, U: HeapSizeOf> HeapSizeOf for Result<T, U> { - fn heap_size_of_children(&self) -> usize { - match *self { - Result::Ok(ref ok) => ok.heap_size_of_children(), - Result::Err(ref err) => err.heap_size_of_children() - } - } -} - -impl HeapSizeOf for () { - fn heap_size_of_children(&self) -> usize { - 0 - } -} - -impl<T: SelectorImpl> HeapSizeOf for Selector<T> - where T::NonTSPseudoClass: HeapSizeOf, - T::PseudoElement: HeapSizeOf { - fn heap_size_of_children(&self) -> usize { - let &Selector { ref compound_selectors, ref pseudo_element, ref specificity } = self; - compound_selectors.heap_size_of_children() + pseudo_element.heap_size_of_children() + - specificity.heap_size_of_children() - } -} - -impl<T: SelectorImpl> HeapSizeOf for CompoundSelector<T> - where T::NonTSPseudoClass: HeapSizeOf { - fn heap_size_of_children(&self) -> usize { - let &CompoundSelector { ref simple_selectors, ref next } = self; - simple_selectors.heap_size_of_children() + next.heap_size_of_children() - } -} - -impl<T: SelectorImpl> HeapSizeOf for SimpleSelector<T> - where T::NonTSPseudoClass: HeapSizeOf { - fn heap_size_of_children(&self) -> usize { - match *self { - SimpleSelector::Negation(ref vec) => vec.heap_size_of_children(), - SimpleSelector::AttrIncludes(_, ref str) | SimpleSelector::AttrPrefixMatch(_, ref str) | - SimpleSelector::AttrSubstringMatch(_, ref str) | SimpleSelector::AttrSuffixMatch(_, ref str) - => str.heap_size_of_children(), - SimpleSelector::AttrEqual(_, ref str, _) => str.heap_size_of_children(), - SimpleSelector::AttrDashMatch(_, ref first, ref second) - => first.heap_size_of_children() + second.heap_size_of_children(), - SimpleSelector::NonTSPseudoClass(ref pseudo_class) - => pseudo_class.heap_size_of_children(), - // All other types come down to Atom, enum or i32, all 0 - _ => 0 - } - } -} - -known_heap_size!(0, u8, u16, u32, u64, usize); -known_heap_size!(0, i8, i16, i32, i64, isize); -known_heap_size!(0, bool, f32, f64); -known_heap_size!(0, AtomicIsize, AtomicUsize); - -known_heap_size!(0, Rect<T>, Point2D<T>, Size2D<T>, Matrix2D<T>, SideOffsets2D<T>, Range<T>); -known_heap_size!(0, Length<T, U>, ScaleFactor<T, U, V>); - -known_heap_size!(0, Au, WritingMode, CSSParserColor, RGBA, Cursor, Matrix4, QualName, Atom, Namespace); -known_heap_size!(0, PagePx, ViewportPx, OsRng); -known_heap_size!(0, TokenSerializationType, LengthOrPercentageOrAuto); - -known_heap_size!(0, Combinator, str); -known_heap_size!(0, Uuid); diff --git a/components/util/non_geckolib.rs b/components/util/non_geckolib.rs index cb047a0ec18..ff09ca5c983 100644 --- a/components/util/non_geckolib.rs +++ b/components/util/non_geckolib.rs @@ -4,20 +4,10 @@ ///! Miscellaneous Code which depends on large libraries that we don't /// depend on in GeckoLib builds. - -use azure::azure_hl::Color; -use html5ever::tree_builder::QuirksMode; -use hyper::header::ContentType; -use hyper::http::RawStatus; -use hyper::method::Method; -use hyper::mime::{Attr, Mime, SubLevel, TopLevel, Value}; use js::conversions::{FromJSValConvertible, ToJSValConvertible, latin1_to_string}; -use js::jsapi::{JSContext, JSString, HandleValue, Heap, MutableHandleValue}; +use js::jsapi::{JSContext, JSString, HandleValue, MutableHandleValue}; use js::jsapi::{JS_GetTwoByteStringCharsAndLength, JS_StringHasLatin1Chars}; -use js::jsval::JSVal; -use js::rust::{GCMethods, ToString}; -use layers::geometry::DevicePixel; -use mem::HeapSizeOf; +use js::rust::ToString; use opts; use std::char; use std::ptr; @@ -99,73 +89,3 @@ pub unsafe fn jsstring_to_str(cx: *mut JSContext, s: *mut JSString) -> DOMString s }) } - -// This is measured properly by the heap measurement implemented in SpiderMonkey. -impl<T: Copy + GCMethods<T>> HeapSizeOf for Heap<T> { - fn heap_size_of_children(&self) -> usize { - 0 - } -} - -impl HeapSizeOf for ContentType { - fn heap_size_of_children(&self) -> usize { - let &ContentType(ref mime) = self; - mime.heap_size_of_children() - } -} - -impl HeapSizeOf for Method { - fn heap_size_of_children(&self) -> usize { - match *self { - Method::Extension(ref str) => str.heap_size_of_children(), - _ => 0 - } - } -} - -impl HeapSizeOf for Mime { - fn heap_size_of_children(&self) -> usize { - let &Mime(ref top_level, ref sub_level, ref vec) = self; - top_level.heap_size_of_children() + sub_level.heap_size_of_children() + - vec.heap_size_of_children() - } -} - -impl HeapSizeOf for TopLevel { - fn heap_size_of_children(&self) -> usize { - match *self { - TopLevel::Ext(ref str) => str.heap_size_of_children(), - _ => 0 - } - } -} - -impl HeapSizeOf for SubLevel { - fn heap_size_of_children(&self) -> usize { - match *self { - SubLevel::Ext(ref str) => str.heap_size_of_children(), - _ => 0 - } - } -} - -impl HeapSizeOf for Attr { - fn heap_size_of_children(&self) -> usize { - match *self { - Attr::Ext(ref str) => str.heap_size_of_children(), - _ => 0 - } - } -} - -impl HeapSizeOf for Value { - fn heap_size_of_children(&self) -> usize { - match *self { - Value::Ext(ref str) => str.heap_size_of_children(), - _ => 0 - } - } -} - - -known_heap_size!(0, Color, DevicePixel, JSVal, QuirksMode, RawStatus); diff --git a/components/util/range.rs b/components/util/range.rs index 07e66b28a6f..8149a1f424c 100644 --- a/components/util/range.rs +++ b/components/util/range.rs @@ -136,7 +136,7 @@ macro_rules! int_range_index { } /// A range of indices -#[derive(Clone, RustcEncodable, Copy, Deserialize, Serialize)] +#[derive(Clone, Copy, Deserialize, HeapSizeOf, RustcEncodable, Serialize)] pub struct Range<I> { begin: I, length: I, diff --git a/components/util/str.rs b/components/util/str.rs index dc3b8df1762..8ffcf67b0e9 100644 --- a/components/util/str.rs +++ b/components/util/str.rs @@ -16,7 +16,7 @@ use std::iter::{Filter, Peekable}; use std::ops::{Deref, DerefMut}; use std::str::{Bytes, CharIndices, FromStr, Split, from_utf8}; -#[derive(Clone, PartialOrd, Ord, PartialEq, Eq, Deserialize, Serialize, Hash, Debug)] +#[derive(Clone, Debug, Deserialize, Eq, Hash, HeapSizeOf, Ord, PartialEq, PartialOrd, Serialize)] pub struct DOMString(String); impl !Send for DOMString {} @@ -220,7 +220,7 @@ pub fn parse_unsigned_integer<T: Iterator<Item=char>>(input: T) -> Option<u32> { }) } -#[derive(Copy, Clone, Debug, PartialEq)] +#[derive(Clone, Copy, Debug, HeapSizeOf, PartialEq)] pub enum LengthOrPercentageOrAuto { Auto, Percentage(f32), diff --git a/components/webdriver_server/Cargo.toml b/components/webdriver_server/Cargo.toml index d489479bc61..20e4ff5c7a4 100644 --- a/components/webdriver_server/Cargo.toml +++ b/components/webdriver_server/Cargo.toml @@ -31,5 +31,5 @@ log = "0.3" hyper = "0.7" rustc-serialize = "0.3.4" regex = "0.1.33" -url = "0.5.4" +url = {version = "0.5.4", features = ["heap_size"]} uuid = "0.1" diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index db38b7e7a2c..796fcb6d639 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -68,7 +68,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "heapsize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -90,7 +90,7 @@ dependencies = [ "core-text 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "freetype 0.1.0 (git+https://github.com/servo/rust-freetype)", - "heapsize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -155,9 +155,11 @@ name = "canvas_traits" version = "0.0.1" dependencies = [ "azure 0.4.0 (git+https://github.com/servo/rust-azure)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_traits 0.0.1", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", "layers 0.2.1 (git+https://github.com/servo/rust-layers)", "offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)", @@ -320,10 +322,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cssparser" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -364,6 +368,8 @@ name = "devtools_traits" version = "0.0.1" dependencies = [ "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", "msg 0.0.1", @@ -480,7 +486,7 @@ name = "euclid" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "heapsize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", @@ -587,6 +593,8 @@ dependencies = [ "freetype 0.1.0 (git+https://github.com/servo/rust-freetype)", "gfx_traits 0.0.1", "harfbuzz-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", "layers 0.2.1 (git+https://github.com/servo/rust-layers)", "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", @@ -605,7 +613,7 @@ dependencies = [ "servo-skia 0.20130412.6 (registry+https://github.com/rust-lang/crates.io-index)", "simd 0.1.0 (git+https://github.com/huonw/simd)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "style 0.0.1", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -619,6 +627,8 @@ version = "0.0.1" dependencies = [ "azure 0.4.0 (git+https://github.com/servo/rust-azure)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "layers 0.2.1 (git+https://github.com/servo/rust-layers)", "msg 0.0.1", "plugins 0.0.1", @@ -728,7 +738,7 @@ dependencies = [ [[package]] name = "heapsize" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -749,15 +759,17 @@ dependencies = [ [[package]] name = "html5ever" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "phf 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -849,7 +861,7 @@ name = "js" version = "0.1.1" source = "git+https://github.com/servo/rust-mozjs#b96675b217534c7742cbfda8150ea0536aedbdfb" dependencies = [ - "heapsize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "mozjs_sys 0.0.0 (git+https://github.com/servo/mozjs)", @@ -887,7 +899,7 @@ dependencies = [ "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "glx 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "heapsize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "io-surface 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -907,11 +919,13 @@ dependencies = [ "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "canvas 0.0.1", "canvas_traits 0.0.1", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "gfx 0.0.1", "gfx_traits 0.0.1", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", "layout_traits 0.0.1", "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -928,7 +942,7 @@ dependencies = [ "serde_json 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "style 0.0.1", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-bidi 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1098,8 +1112,10 @@ name = "msg" version = "0.0.1" dependencies = [ "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", "layers 0.2.1 (git+https://github.com/servo/rust-layers)", @@ -1152,6 +1168,8 @@ dependencies = [ name = "net_traits" version = "0.0.1" dependencies = [ + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", @@ -1437,13 +1455,15 @@ dependencies = [ "canvas 0.0.1", "canvas_traits 0.0.1", "caseless 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "devtools_traits 0.0.1", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_traits 0.0.1", - "html5ever 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", @@ -1463,7 +1483,7 @@ dependencies = [ "selectors 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "style 0.0.1", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1483,6 +1503,8 @@ dependencies = [ "devtools_traits 0.0.1", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_traits 0.0.1", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", @@ -1504,12 +1526,14 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "quickersort 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1712,10 +1736,12 @@ dependencies = [ [[package]] name = "string_cache" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "debug_unreachable 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "phf_generator 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "phf_shared 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1728,10 +1754,12 @@ version = "0.0.1" dependencies = [ "app_units 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1742,7 +1770,7 @@ dependencies = [ "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "style_traits 0.0.1", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1753,8 +1781,10 @@ dependencies = [ name = "style_traits" version = "0.0.1" dependencies = [ - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1869,6 +1899,8 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1901,10 +1933,12 @@ dependencies = [ "app_units 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "azure 0.4.0 (git+https://github.com/servo/rust-azure)", "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", - "html5ever 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", "js 0.1.1 (git+https://github.com/servo/rust-mozjs)", @@ -1922,7 +1956,7 @@ dependencies = [ "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2095,7 +2129,7 @@ dependencies = [ "phf 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/ports/cef/Cargo.toml b/ports/cef/Cargo.toml index b03fce61e53..a47bfe10e21 100644 --- a/ports/cef/Cargo.toml +++ b/ports/cef/Cargo.toml @@ -14,7 +14,7 @@ gleam = "0.2" libc = "0.2" log = "0.3" stb_image = "0.2" -url = "0.5.4" +url = {version = "0.5.4", features = ["heap_size"]} [dependencies.servo] path = "../../components/servo" diff --git a/ports/geckolib/Cargo.lock b/ports/geckolib/Cargo.lock index 199881d2538..723c8b24092 100644 --- a/ports/geckolib/Cargo.lock +++ b/ports/geckolib/Cargo.lock @@ -4,14 +4,14 @@ version = "0.0.1" dependencies = [ "app_units 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "selectors 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "style 0.0.1", "url 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", @@ -32,7 +32,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "heapsize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -67,10 +67,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cssparser" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -146,7 +148,7 @@ name = "euclid" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "heapsize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", @@ -167,7 +169,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "heapsize" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -317,12 +319,14 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "quickersort 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -358,10 +362,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "string_cache" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "debug_unreachable 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "phf_generator 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "phf_shared 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -374,10 +380,12 @@ version = "0.0.1" dependencies = [ "app_units 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -388,7 +396,7 @@ dependencies = [ "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "style_traits 0.0.1", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -399,8 +407,10 @@ dependencies = [ name = "style_traits" version = "0.0.1" dependencies = [ - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", @@ -454,6 +464,8 @@ name = "url" version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -468,9 +480,11 @@ version = "0.0.1" dependencies = [ "app_units 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", "kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", @@ -485,7 +499,7 @@ dependencies = [ "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/ports/geckolib/Cargo.toml b/ports/geckolib/Cargo.toml index 3e5d754c718..5a511a004c0 100644 --- a/ports/geckolib/Cargo.toml +++ b/ports/geckolib/Cargo.toml @@ -11,15 +11,15 @@ crate-type = ["staticlib"] [dependencies] app_units = {version = "0.2", features = ["plugins"]} bitflags = "0.3" -cssparser = { version = "0.5", features = [ "serde-serialization" ] } +cssparser = {version = "0.5.2", features = ["heap_size", "serde-serialization"]} euclid = {version = "0.6.1", features = ["plugins"]} libc = "0.2" log = "0.3" num_cpus = "0.2.2" -selectors = "0.4.1" +selectors = {version = "0.4.1", features = ["heap_size"]} smallvec = "0.1" -string_cache = "0.2" -url = "0.5.4" +string_cache = {version = "0.2.7", features = ["heap_size"]} +url = {version = "0.5.4", features = ["heap_size"]} [dependencies.util] path = "../../components/util" diff --git a/ports/glutin/Cargo.toml b/ports/glutin/Cargo.toml index 6bc2f3be2e7..c0713022b14 100644 --- a/ports/glutin/Cargo.toml +++ b/ports/glutin/Cargo.toml @@ -13,7 +13,7 @@ headless = ["servo-glutin/headless"] [dependencies] bitflags = "0.3" -url = "0.5.4" +url = {version = "0.5.4", features = ["heap_size"]} gleam = "0.2" euclid = {version = "0.6.1", features = ["plugins"]} servo-glutin = "0.4" diff --git a/ports/gonk/Cargo.lock b/ports/gonk/Cargo.lock index b9e65f6d501..09893b87e30 100644 --- a/ports/gonk/Cargo.lock +++ b/ports/gonk/Cargo.lock @@ -60,7 +60,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "heapsize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -82,7 +82,7 @@ dependencies = [ "core-text 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "freetype 0.1.0 (git+https://github.com/servo/rust-freetype)", - "heapsize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -147,9 +147,11 @@ name = "canvas_traits" version = "0.0.1" dependencies = [ "azure 0.4.0 (git+https://github.com/servo/rust-azure)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_traits 0.0.1", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", "layers 0.2.1 (git+https://github.com/servo/rust-layers)", "offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)", @@ -312,10 +314,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cssparser" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -356,6 +360,8 @@ name = "devtools_traits" version = "0.0.1" dependencies = [ "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", "msg 0.0.1", @@ -482,7 +488,7 @@ name = "euclid" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "heapsize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", @@ -589,6 +595,8 @@ dependencies = [ "freetype 0.1.0 (git+https://github.com/servo/rust-freetype)", "gfx_traits 0.0.1", "harfbuzz-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", "layers 0.2.1 (git+https://github.com/servo/rust-layers)", "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", @@ -607,7 +615,7 @@ dependencies = [ "servo-skia 0.20130412.6 (registry+https://github.com/rust-lang/crates.io-index)", "simd 0.1.0 (git+https://github.com/huonw/simd)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "style 0.0.1", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -621,6 +629,8 @@ version = "0.0.1" dependencies = [ "azure 0.4.0 (git+https://github.com/servo/rust-azure)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "layers 0.2.1 (git+https://github.com/servo/rust-layers)", "msg 0.0.1", "plugins 0.0.1", @@ -710,7 +720,7 @@ dependencies = [ [[package]] name = "heapsize" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -731,15 +741,17 @@ dependencies = [ [[package]] name = "html5ever" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "phf 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -831,7 +843,7 @@ name = "js" version = "0.1.1" source = "git+https://github.com/servo/rust-mozjs#b96675b217534c7742cbfda8150ea0536aedbdfb" dependencies = [ - "heapsize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "mozjs_sys 0.0.0 (git+https://github.com/servo/mozjs)", @@ -869,7 +881,7 @@ dependencies = [ "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "glx 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "heapsize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "io-surface 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -889,11 +901,13 @@ dependencies = [ "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "canvas 0.0.1", "canvas_traits 0.0.1", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "gfx 0.0.1", "gfx_traits 0.0.1", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", "layout_traits 0.0.1", "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -910,7 +924,7 @@ dependencies = [ "serde_json 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "style 0.0.1", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-bidi 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1080,8 +1094,10 @@ name = "msg" version = "0.0.1" dependencies = [ "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", "layers 0.2.1 (git+https://github.com/servo/rust-layers)", @@ -1134,6 +1150,8 @@ dependencies = [ name = "net_traits" version = "0.0.1" dependencies = [ + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", @@ -1419,13 +1437,15 @@ dependencies = [ "canvas 0.0.1", "canvas_traits 0.0.1", "caseless 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "devtools_traits 0.0.1", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_traits 0.0.1", - "html5ever 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", @@ -1445,7 +1465,7 @@ dependencies = [ "selectors 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "style 0.0.1", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1465,6 +1485,8 @@ dependencies = [ "devtools_traits 0.0.1", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_traits 0.0.1", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", @@ -1486,12 +1508,14 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "quickersort 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1692,10 +1716,12 @@ dependencies = [ [[package]] name = "string_cache" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "debug_unreachable 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "phf_generator 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "phf_shared 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1708,10 +1734,12 @@ version = "0.0.1" dependencies = [ "app_units 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1722,7 +1750,7 @@ dependencies = [ "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "style_traits 0.0.1", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1733,8 +1761,10 @@ dependencies = [ name = "style_traits" version = "0.0.1" dependencies = [ - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1849,6 +1879,8 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1881,10 +1913,12 @@ dependencies = [ "app_units 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "azure 0.4.0 (git+https://github.com/servo/rust-azure)", "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", - "html5ever 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.0 (git+https://github.com/servo/ipc-channel)", "js 0.1.1 (git+https://github.com/servo/rust-mozjs)", @@ -1902,7 +1936,7 @@ dependencies = [ "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2044,7 +2078,7 @@ dependencies = [ "phf 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/ports/gonk/Cargo.toml b/ports/gonk/Cargo.toml index 7a58e64fa99..b153f530ab7 100644 --- a/ports/gonk/Cargo.toml +++ b/ports/gonk/Cargo.toml @@ -46,7 +46,7 @@ features = ["non-geckolib"] [dependencies] env_logger = "0.3" -url = "0.5.4" +url = {version = "0.5.4", features = ["heap_size"]} time = "0.1.17" errno = "0.1" libc = "0.2" diff --git a/tests/unit/net/Cargo.toml b/tests/unit/net/Cargo.toml index bc1d49dade6..eb585685388 100644 --- a/tests/unit/net/Cargo.toml +++ b/tests/unit/net/Cargo.toml @@ -32,6 +32,6 @@ git = "https://github.com/servo/ipc-channel" [dependencies] cookie = "0.2" hyper = "0.7" -url = "0.5.4" +url = {version = "0.5.4", features = ["heap_size"]} time = "0.1" flate2 = "0.2.0" diff --git a/tests/unit/plugin/Cargo.toml b/tests/unit/plugin/Cargo.toml index 286b918c476..19466cd7516 100644 --- a/tests/unit/plugin/Cargo.toml +++ b/tests/unit/plugin/Cargo.toml @@ -12,4 +12,4 @@ doctest = false path = "../../../components/plugins" [dependencies] -url = "0.5.4" +url = {version = "0.5.4", features = ["heap_size"]} diff --git a/tests/unit/script/size_of.rs b/tests/unit/script/size_of.rs index b89ca9dd837..f760d610862 100644 --- a/tests/unit/script/size_of.rs +++ b/tests/unit/script/size_of.rs @@ -38,10 +38,10 @@ macro_rules! sizeof_checker ( // Update the sizes here sizeof_checker!(size_event_target, EventTarget, 40); -sizeof_checker!(size_node, Node, 168); -sizeof_checker!(size_element, Element, 312); -sizeof_checker!(size_htmlelement, HTMLElement, 328); -sizeof_checker!(size_div, HTMLDivElement, 328); -sizeof_checker!(size_span, HTMLSpanElement, 328); -sizeof_checker!(size_text, Text, 200); -sizeof_checker!(size_characterdata, CharacterData, 200); +sizeof_checker!(size_node, Node, 160); +sizeof_checker!(size_element, Element, 304); +sizeof_checker!(size_htmlelement, HTMLElement, 320); +sizeof_checker!(size_div, HTMLDivElement, 320); +sizeof_checker!(size_span, HTMLSpanElement, 320); +sizeof_checker!(size_text, Text, 192); +sizeof_checker!(size_characterdata, CharacterData, 192); diff --git a/tests/unit/style/Cargo.toml b/tests/unit/style/Cargo.toml index 9be4fb4eb30..0365fe27b94 100644 --- a/tests/unit/style/Cargo.toml +++ b/tests/unit/style/Cargo.toml @@ -25,8 +25,8 @@ path = "../../../components/util" [dependencies] app_units = {version = "0.2", features = ["plugins"]} -url = "0.5.4" -cssparser = "0.5" -selectors = "0.4.1" -string_cache = "0.2" +url = {version = "0.5.4", features = ["heap_size"]} +cssparser = {version = "0.5.2", features = ["heap_size"]} +selectors = {version = "0.4.1", features = ["heap_size"]} +string_cache = {version = "0.2.7", features = ["heap_size"]} euclid = {version = "0.6.1", features = ["plugins"]} diff --git a/tests/unit/util/lib.rs b/tests/unit/util/lib.rs index b42b58ddd7b..72ca23df7ca 100644 --- a/tests/unit/util/lib.rs +++ b/tests/unit/util/lib.rs @@ -16,6 +16,5 @@ extern crate util; #[cfg(test)] mod logical_geometry; #[cfg(test)] mod thread; #[cfg(test)] mod vec; -#[cfg(test)] mod mem; #[cfg(test)] mod str; #[cfg(test)] mod opts; diff --git a/tests/unit/util/mem.rs b/tests/unit/util/mem.rs deleted file mode 100644 index 9b9ac4729e1..00000000000 --- a/tests/unit/util/mem.rs +++ /dev/null @@ -1,106 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -use libc::c_void; -use util::mem::{HeapSizeOf, heap_size_of}; - -struct Four; -impl HeapSizeOf for Four { - fn heap_size_of_children(&self) -> usize { - 4 - } -} - -#[derive(HeapSizeOf)] -struct Eight(Four, Four, bool, bool, bool); - -#[derive(HeapSizeOf)] -enum EightOrFour { - Eight(Eight), - Four(Four), - Zero(u8) -} - -#[test] -fn test_heap_size() { - - // Note: jemalloc often rounds up request sizes. However, it does not round up for request - // sizes of 8 and higher that are powers of two. We take advantage of knowledge here to make - // the sizes of various heap-allocated blocks predictable. - - //----------------------------------------------------------------------- - // Start with basic heap block measurement. - - unsafe { - // EMPTY is the special non-null address used to represent zero-size allocations. - assert_eq!(heap_size_of(::alloc::heap::EMPTY as *const c_void), 0); - - // A 64 byte request is allocated exactly. - let x = ::alloc::heap::allocate(64, 0); - assert_eq!(heap_size_of(x as *const c_void), 64); - ::alloc::heap::deallocate(x, 64, 0); - - // A 255 byte request is rounded up to 256 bytes. - let x = ::alloc::heap::allocate(255, 0); - assert_eq!(heap_size_of(x as *const c_void), 256); - ::alloc::heap::deallocate(x, 255, 0); - - // A 1MiB request is allocated exactly. - let x = ::alloc::heap::allocate(1024 * 1024, 0); - assert_eq!(heap_size_of(x as *const c_void), 1024 * 1024); - ::alloc::heap::deallocate(x, 1024 * 1024, 0); - } - - //----------------------------------------------------------------------- - // Test HeapSizeOf implementations for various built-in types. - - // Not on the heap; 0 bytes. - let x = 0i64; - assert_eq!(x.heap_size_of_children(), 0); - - // An i64 is 8 bytes. - let x = Box::new(0i64); - assert_eq!(x.heap_size_of_children(), 8); - - // An ascii string with 16 chars is 16 bytes in UTF-8. - assert_eq!(String::from("0123456789abcdef").heap_size_of_children(), 16); - - // Not on the heap. - let x: Option<i32> = None; - assert_eq!(x.heap_size_of_children(), 0); - - // Not on the heap. - let x = Some(0i64); - assert_eq!(x.heap_size_of_children(), 0); - - // The `Some` is not on the heap, but the Box is. - let x = Some(Box::new(0i64)); - assert_eq!(x.heap_size_of_children(), 8); - - // Not on the heap. - let x = ::std::sync::Arc::new(0i64); - assert_eq!(x.heap_size_of_children(), 0); - - // The `Arc` is not on the heap, but the Box is. - let x = ::std::sync::Arc::new(Box::new(0i64)); - assert_eq!(x.heap_size_of_children(), 8); - - // Zero elements, no heap storage. - let x: Vec<i64> = vec![]; - assert_eq!(x.heap_size_of_children(), 0); - - // Four elements, 8 bytes per element. - let x = vec![0i64, 1i64, 2i64, 3i64]; - assert_eq!(x.heap_size_of_children(), 32); - - //----------------------------------------------------------------------- - // Test the HeapSizeOf auto-deriving. - - assert_eq!(Four.heap_size_of_children(), 4); - let eight = Eight(Four, Four, true, true, true); - assert_eq!(eight.heap_size_of_children(), 8); - assert_eq!(EightOrFour::Eight(eight).heap_size_of_children(), 8); - assert_eq!(EightOrFour::Four(Four).heap_size_of_children(), 4); - assert_eq!(EightOrFour::Zero(1).heap_size_of_children(), 0); -} |