aboutsummaryrefslogtreecommitdiffstats
path: root/components/net_traits/request.rs
diff options
context:
space:
mode:
authorMs2ger <Ms2ger@gmail.com>2016-12-08 11:46:57 -1000
committerMs2ger <Ms2ger@gmail.com>2016-12-08 12:05:44 -1000
commit12aa4694cb7a982abf9c9709fe591bb30eeed6ac (patch)
tree7c2f479d757741152b932731aa6135d3882364fe /components/net_traits/request.rs
parent1e3d4d272de53e77334b1c32d3e3737f935c4cde (diff)
downloadservo-12aa4694cb7a982abf9c9709fe591bb30eeed6ac.tar.gz
servo-12aa4694cb7a982abf9c9709fe591bb30eeed6ac.zip
Rewrite determine_request_referrer() to explicitly limit it to the checks it can do.
Checks for the Client value should reside in the script thread. I also noted some other issues in this code.
Diffstat (limited to 'components/net_traits/request.rs')
-rw-r--r--components/net_traits/request.rs16
1 files changed, 0 insertions, 16 deletions
diff --git a/components/net_traits/request.rs b/components/net_traits/request.rs
index 795a8556f6f..3c780a2c5d5 100644
--- a/components/net_traits/request.rs
+++ b/components/net_traits/request.rs
@@ -9,7 +9,6 @@ use msg::constellation_msg::PipelineId;
use servo_url::ServoUrl;
use std::cell::{Cell, RefCell};
use std::default::Default;
-use std::mem::swap;
use url::{Origin as UrlOrigin};
/// An [initiator](https://fetch.spec.whatwg.org/#concept-request-initiator)
@@ -308,19 +307,4 @@ impl Referrer {
Referrer::ReferrerUrl(ref url) => Some(url)
}
}
- pub fn from_url(url: Option<ServoUrl>) -> Self {
- if let Some(url) = url {
- Referrer::ReferrerUrl(url)
- } else {
- Referrer::NoReferrer
- }
- }
- pub fn take(&mut self) -> Option<ServoUrl> {
- let mut new = Referrer::Client;
- swap(self, &mut new);
- match new {
- Referrer::NoReferrer | Referrer::Client => None,
- Referrer::ReferrerUrl(url) => Some(url)
- }
- }
}