Use common cookie struct add cookie webdriver cmds

One cookie struct to rule them all. One struct to represent them.
One cookie struct to bind them all, and through the IPC carry them.
This commit is contained in:
Dan Robertson 2016-06-25 20:06:17 +00:00
parent 7d978e7b3d
commit 246723114f
No known key found for this signature in database
GPG key ID: 1BE34CFA559DED58
19 changed files with 214 additions and 23 deletions

View file

@ -6,6 +6,7 @@
//! http://tools.ietf.org/html/rfc6265
use cookie::Cookie;
use cookie_rs;
use net_traits::CookieSource;
use std::cmp::Ordering;
use url::Url;
@ -114,4 +115,12 @@ impl CookieStorage {
_ => Some(result)
}
}
pub fn cookies_data_for_url<'a>(&'a mut self, url: &'a Url,
source: CookieSource) -> Box<Iterator<Item=cookie_rs::Cookie> + 'a> {
Box::new(self.cookies.iter_mut().filter(move |c| { c.appropriate_for_url(url, source) }).map(|c| {
c.touch();
c.cookie.clone()
}))
}
}