mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
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:
parent
7d978e7b3d
commit
246723114f
19 changed files with 214 additions and 23 deletions
|
@ -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()
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue