Say farewell to in-tree HeapSizeOf

This commit is contained in:
Anthony Ramine 2016-01-30 15:06:31 +01:00
parent 9932a5cf82
commit cb5cd8d881
80 changed files with 245 additions and 733 deletions

View file

@ -66,11 +66,13 @@ path = "../gfx_traits"
app_units = {version = "0.2", features = ["plugins"]}
bitflags = "0.3"
caseless = "0.1.0"
cssparser = {version = "0.5.2", features = ["serde-serialization"]}
cssparser = {version = "0.5.2", features = ["heap_size", "serde-serialization"]}
encoding = "0.2"
euclid = {version = "0.6.1", features = ["plugins"]}
fnv = "1.0"
html5ever = {version = "0.4.2", features = ["unstable"]}
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" ] }
image = "0.5.0"
libc = "0.2"
@ -79,12 +81,12 @@ num = "0.1.24"
rand = "0.3"
ref_slice = "0.1.0"
rustc-serialize = "0.3"
selectors = "0.4.1"
selectors = {version = "0.4.1", features = ["heap_size"]}
serde = "0.6"
smallvec = "0.1"
string_cache = {version = "0.2.7", features = ["unstable"]}
string_cache = {version = "0.2.7", features = ["heap_size", "unstable"]}
time = "0.1.12"
unicase = "1.0"
url = "0.5.4"
url = {version = "0.5.4", features = ["heap_size"]}
uuid = "0.1.16"
websocket = "0.14.0"

View file

@ -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,

View file

@ -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)]

View file

@ -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

View file

@ -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.

View file

@ -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.

View file

@ -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,

View file

@ -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>,
}

View file

@ -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,

View file

@ -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)]

View file

@ -46,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};
@ -63,7 +64,6 @@ use std::iter::{self, FilterMap, Peekable};
use std::mem;
use string_cache::{Atom, Namespace, QualName};
use style::selector_impl::ServoSelectorImpl;
use util::mem::{HeapSizeOf, heap_size_of};
use util::str::DOMString;
use util::thread_state;
use uuid::Uuid;

View file

@ -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]

View file

@ -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"]

View file

@ -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;

View file

@ -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

View file

@ -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)]

View file

@ -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)]