diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-08-13 13:16:14 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-08-13 13:16:14 -0600 |
commit | a03616f379c255cc6c9b6e1d04dd7d98bd9926ce (patch) | |
tree | 0081f3c1bb513706b406a61fba0f73449cbc5ba4 /components/script/cors.rs | |
parent | f3b7c5cb4b0fab20db51b7560c3b3bb2d115be69 (diff) | |
parent | 45145108daa6af7e834a7c23530857c504b54b9c (diff) | |
download | servo-a03616f379c255cc6c9b6e1d04dd7d98bd9926ce.tar.gz servo-a03616f379c255cc6c9b6e1d04dd7d98bd9926ce.zip |
Auto merge of #7097 - boghison:memtypes, r=jdm
Measure heap memory usage for more types. Fixes #6951
Also adds HeapSizeOf implementations/derive for some types. I've used "Cannot calculate Heap size" as a reason everywhere, because my imagination is rather limited. If you'd like me to change this message for specific types, please write something like this: "Trusted - Cannot calculate Heap size for Trusted" so that it would be easier for me to replace them through a script :)
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7097)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/cors.rs')
-rw-r--r-- | components/script/cors.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/components/script/cors.rs b/components/script/cors.rs index b1a1e56cb02..744864abed9 100644 --- a/components/script/cors.rs +++ b/components/script/cors.rs @@ -32,6 +32,7 @@ use hyper::status::StatusClass::Success; use unicase::UniCase; use url::{SchemeData, Url}; +use util::mem::HeapSizeOf; use util::task::spawn_named; /// Interface for network listeners concerned with CORS checks. Proper network requests @@ -40,12 +41,13 @@ pub trait AsyncCORSResponseListener { fn response_available(&self, response: CORSResponse); } -#[derive(Clone)] +#[derive(Clone, HeapSizeOf)] pub struct CORSRequest { pub origin: Url, pub destination: Url, pub mode: RequestMode, pub method: Method, + #[ignore_heap_size_of = "Defined in hyper"] pub headers: Headers, /// CORS preflight flag (https://fetch.spec.whatwg.org/#concept-http-fetch) /// Indicates that a CORS preflight request and/or cache check is to be performed @@ -55,7 +57,7 @@ pub struct CORSRequest { /// https://fetch.spec.whatwg.org/#concept-request-mode /// This only covers some of the request modes. The /// `same-origin` and `no CORS` modes are unnecessary for XHR. -#[derive(PartialEq, Copy, Clone)] +#[derive(PartialEq, Copy, Clone, HeapSizeOf)] pub enum RequestMode { CORS, // CORS ForcedPreflight // CORS-with-forced-preflight |