Bug 1504644 - Cherry-pick servo/servo#21644.
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 05 Nov 2018 12:16:43 +0100
changeset 444404 3df6c21d639bd1e7268bc36ad9721d929570c59c
parent 444403 9d8ba342b6488357a6fd63583f34e311024ce1fc
child 444405 2a5f5696ddcc91affee16f8241fbd02415edbe17
push id109582
push usercsabou@mozilla.com
push dateMon, 05 Nov 2018 16:21:20 +0000
treeherdermozilla-inbound@4115e3cf7ad0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1504644, 21644
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1504644 - Cherry-pick servo/servo#21644.
servo/components/malloc_size_of/Cargo.toml
servo/components/malloc_size_of/lib.rs
--- a/servo/components/malloc_size_of/Cargo.toml
+++ b/servo/components/malloc_size_of/Cargo.toml
@@ -24,20 +24,20 @@ servo = [
     "xml5ever",
 ]
 
 [dependencies]
 app_units = "0.7"
 cssparser = "0.25"
 euclid = "0.19"
 hashglobe = { path = "../hashglobe" }
-hyper = { version = "0.10", optional = true }
-hyper_serde = { version = "0.8", optional = true }
+hyper = { version = "0.12", optional = true }
+hyper_serde = { version = "0.9", optional = true }
 keyboard-types = {version = "0.4.2-servo", features = ["serde"], optional = true}
-mozjs = { version = "0.9.0", optional = true }
+mozjs = { version = "0.9.3", optional = true }
 selectors = { path = "../selectors" }
 serde = { version = "1.0.27", optional = true }
 serde_bytes = { version = "0.10", optional = true }
 servo_arc = { path = "../servo_arc" }
 servo_channel = { path = "../channel", optional = true }
 smallbitvec = "2.1.0"
 smallvec = "0.6"
 string_cache = { version = "0.7", optional = true }
--- a/servo/components/malloc_size_of/lib.rs
+++ b/servo/components/malloc_size_of/lib.rs
@@ -973,58 +973,16 @@ malloc_size_of_is_0!(keyboard_types::Mod
 #[cfg(feature = "servo")]
 impl MallocSizeOf for xml5ever::QualName {
     fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
         self.prefix.size_of(ops) + self.ns.size_of(ops) + self.local.size_of(ops)
     }
 }
 
 #[cfg(feature = "servo")]
-impl MallocSizeOf for hyper::header::Headers {
-    fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
-        self.iter().fold(0, |acc, x| {
-            let name = x.name();
-            let raw = self.get_raw(name);
-            acc + raw.size_of(ops)
-        })
-    }
-}
-
-#[cfg(feature = "servo")]
-impl MallocSizeOf for hyper::header::ContentType {
-    fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
-        self.0.size_of(ops)
-    }
-}
-
-#[cfg(feature = "servo")]
-impl MallocSizeOf for hyper::mime::Mime {
-    fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
-        self.0.size_of(ops) + self.1.size_of(ops) + self.2.size_of(ops)
-    }
-}
-
-#[cfg(feature = "servo")]
-impl MallocSizeOf for hyper::mime::Attr {
-    fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
-        match *self {
-            hyper::mime::Attr::Ext(ref s) => s.size_of(ops),
-            _ => 0,
-        }
-    }
-}
-
-#[cfg(feature = "servo")]
-impl MallocSizeOf for hyper::mime::Value {
-    fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize {
-        self.len() // Length of string value in bytes (not the char length of a string)!
-    }
-}
-
-#[cfg(feature = "servo")]
 malloc_size_of_is_0!(time::Duration);
 #[cfg(feature = "servo")]
 malloc_size_of_is_0!(time::Tm);
 
 #[cfg(feature = "servo")]
 impl<T> MallocSizeOf for hyper_serde::Serde<T>
 where
     for<'de> hyper_serde::De<T>: serde::Deserialize<'de>,
@@ -1041,22 +999,19 @@ where
 #[cfg(feature = "servo")]
 impl<T> MallocSizeOf for servo_channel::Sender<T> {
     fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize {
         0
     }
 }
 
 #[cfg(feature = "servo")]
-impl MallocSizeOf for hyper::status::StatusCode {
-    fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
-        match *self {
-            hyper::status::StatusCode::Unregistered(u) => u.size_of(ops),
-            _ => 0,
-        }
+impl MallocSizeOf for hyper::StatusCode {
+    fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize {
+        0
     }
 }
 
 /// Measurable that defers to inner value and used to verify MallocSizeOf implementation in a
 /// struct.
 #[derive(Clone)]
 pub struct Measurable<T: MallocSizeOf>(pub T);