Auto merge of #23299 - jdm:minimize-mozjs-deps, r=Manishearth

Remove mozjs dep from malloc_size_of.

This makes making local changes to mozjs_sys much more frustrating than it should be, and blocks merging #22130.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23299)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-05-06 12:46:09 -04:00 committed by GitHub
commit 64c848950c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 30 additions and 16 deletions

View file

@ -42,6 +42,7 @@ type JSAudioChannel = Heap<*mut JSObject>;
pub struct AudioBuffer {
reflector_: Reflector,
/// Float32Arrays returned by calls to GetChannelData.
#[ignore_malloc_size_of = "mozjs"]
js_channels: DomRefCell<Vec<JSAudioChannel>>,
/// Aggregates the data from js_channels.
/// This is Some<T> iff the buffers in js_channels are detached.

View file

@ -719,7 +719,7 @@ pub enum CustomElementReaction {
Upgrade(#[ignore_malloc_size_of = "Rc"] Rc<CustomElementDefinition>),
Callback(
#[ignore_malloc_size_of = "Rc"] Rc<Function>,
Box<[Heap<JSVal>]>,
#[ignore_malloc_size_of = "mozjs"] Box<[Heap<JSVal>]>,
),
}

View file

@ -24,6 +24,7 @@ use servo_atoms::Atom;
#[dom_struct]
pub struct ExtendableMessageEvent {
event: ExtendableEvent,
#[ignore_malloc_size_of = "mozjs"]
data: Heap<JSVal>,
origin: DOMString,
lastEventId: DOMString,

View file

@ -83,7 +83,7 @@ pub enum FileReaderReadyState {
#[derive(JSTraceable, MallocSizeOf)]
pub enum FileReaderResult {
ArrayBuffer(Heap<JSVal>),
ArrayBuffer(#[ignore_malloc_size_of = "mozjs"] Heap<JSVal>),
String(DOMString),
}

View file

@ -32,6 +32,7 @@ pub struct Gamepad {
connected: Cell<bool>,
timestamp: Cell<f64>,
mapping_type: String,
#[ignore_malloc_size_of = "mozjs"]
axes: Heap<*mut JSObject>,
buttons: Dom<GamepadButtonList>,
pose: Option<Dom<VRPose>>,

View file

@ -145,6 +145,7 @@ pub struct GlobalScope {
/// they're consumed before it'd be reported.
///
/// <https://html.spec.whatwg.org/multipage/#about-to-be-notified-rejected-promises-list>
#[ignore_malloc_size_of = "mozjs"]
uncaught_rejections: DomRefCell<Vec<Box<Heap<*mut JSObject>>>>,
/// Promises in this list have previously been reported as rejected
@ -152,6 +153,7 @@ pub struct GlobalScope {
/// in the last turn of the event loop.
///
/// <https://html.spec.whatwg.org/multipage/#outstanding-rejected-promises-weak-set>
#[ignore_malloc_size_of = "mozjs"]
consumed_rejections: DomRefCell<Vec<Box<Heap<*mut JSObject>>>>,
}

View file

@ -40,6 +40,7 @@ enum PushOrReplace {
pub struct History {
reflector_: Reflector,
window: Dom<Window>,
#[ignore_malloc_size_of = "mozjs"]
state: Heap<JSVal>,
state_id: Cell<Option<HistoryStateId>>,
}

View file

@ -25,6 +25,7 @@ pub struct ImageData {
reflector_: Reflector,
width: u32,
height: u32,
#[ignore_malloc_size_of = "mozjs"]
data: Heap<*mut JSObject>,
}

View file

@ -25,6 +25,7 @@ use std::ptr::NonNull;
#[dom_struct]
pub struct MessageEvent {
event: Event,
#[ignore_malloc_size_of = "mozjs"]
data: Heap<JSVal>,
origin: DOMString,
source: Option<Dom<WindowProxy>>,

View file

@ -76,6 +76,7 @@ pub struct PaintWorkletGlobalScope {
/// <https://drafts.css-houdini.org/css-paint-api/#paint-definitions>
paint_definitions: DomRefCell<HashMap<Atom, Box<PaintDefinition>>>,
/// <https://drafts.css-houdini.org/css-paint-api/#paint-class-instances>
#[ignore_malloc_size_of = "mozjs"]
paint_class_instances: DomRefCell<HashMap<Atom, Box<Heap<JSVal>>>>,
/// The most recent name the worklet was called with
cached_name: DomRefCell<Atom>,
@ -473,7 +474,9 @@ pub enum PaintWorkletTask {
#[derive(JSTraceable, MallocSizeOf)]
#[must_root]
struct PaintDefinition {
#[ignore_malloc_size_of = "mozjs"]
class_constructor: Heap<JSVal>,
#[ignore_malloc_size_of = "mozjs"]
paint_function: Heap<JSVal>,
constructor_valid_flag: Cell<bool>,
context_alpha_flag: bool,

View file

@ -22,6 +22,7 @@ pub struct VREyeParameters {
reflector_: Reflector,
#[ignore_malloc_size_of = "Defined in rust-webvr"]
parameters: DomRefCell<WebVREyeParameters>,
#[ignore_malloc_size_of = "mozjs"]
offset: Heap<*mut JSObject>,
fov: Dom<VRFieldOfView>,
}

View file

@ -22,9 +22,13 @@ use webvr_traits::WebVRFrameData;
#[dom_struct]
pub struct VRFrameData {
reflector_: Reflector,
#[ignore_malloc_size_of = "mozjs"]
left_proj: Heap<*mut JSObject>,
#[ignore_malloc_size_of = "mozjs"]
left_view: Heap<*mut JSObject>,
#[ignore_malloc_size_of = "mozjs"]
right_proj: Heap<*mut JSObject>,
#[ignore_malloc_size_of = "mozjs"]
right_view: Heap<*mut JSObject>,
pose: Dom<VRPose>,
timestamp: Cell<f64>,

View file

@ -17,11 +17,17 @@ use webvr_traits::webvr;
#[dom_struct]
pub struct VRPose {
reflector_: Reflector,
#[ignore_malloc_size_of = "mozjs"]
position: Heap<*mut JSObject>,
#[ignore_malloc_size_of = "mozjs"]
orientation: Heap<*mut JSObject>,
#[ignore_malloc_size_of = "mozjs"]
linear_vel: Heap<*mut JSObject>,
#[ignore_malloc_size_of = "mozjs"]
angular_vel: Heap<*mut JSObject>,
#[ignore_malloc_size_of = "mozjs"]
linear_acc: Heap<*mut JSObject>,
#[ignore_malloc_size_of = "mozjs"]
angular_acc: Heap<*mut JSObject>,
}

View file

@ -21,6 +21,7 @@ pub struct VRStageParameters {
reflector_: Reflector,
#[ignore_malloc_size_of = "Defined in rust-webvr"]
parameters: DomRefCell<WebVRStageParameters>,
#[ignore_malloc_size_of = "mozjs"]
transform: Heap<*mut JSObject>,
}

View file

@ -137,6 +137,7 @@ pub struct XMLHttpRequest {
response_type: Cell<XMLHttpRequestResponseType>,
response_xml: MutNullableDom<Document>,
response_blob: MutNullableDom<Blob>,
#[ignore_malloc_size_of = "mozjs"]
response_arraybuffer: Heap<*mut JSObject>,
#[ignore_malloc_size_of = "Defined in rust-mozjs"]
response_json: Heap<JSVal>,

View file

@ -27,6 +27,7 @@ pub struct XRRigidTransform {
#[ignore_malloc_size_of = "defined in euclid"]
transform: RigidTransform3D<f64>,
inverse: MutNullableDom<XRRigidTransform>,
#[ignore_malloc_size_of = "defined in mozjs"]
matrix: Heap<*mut JSObject>,
}

View file

@ -21,7 +21,9 @@ pub struct XRView {
reflector_: Reflector,
session: Dom<XRSession>,
eye: XREye,
#[ignore_malloc_size_of = "mozjs"]
proj: Heap<*mut JSObject>,
#[ignore_malloc_size_of = "mozjs"]
view: Heap<*mut JSObject>,
transform: Dom<XRRigidTransform>,
}

View file

@ -22,6 +22,7 @@ use webvr_traits::WebVRFrameData;
#[dom_struct]
pub struct XRViewerPose {
pose: XRPose,
#[ignore_malloc_size_of = "mozjs"]
views: Heap<JSVal>,
}