mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Introduce GlobalScope::resource_threads
This commit is contained in:
parent
86d2008137
commit
bad49e4696
10 changed files with 41 additions and 44 deletions
|
@ -2728,7 +2728,10 @@ impl DocumentMethods for Document {
|
|||
|
||||
let url = self.url();
|
||||
let (tx, rx) = ipc::channel().unwrap();
|
||||
let _ = self.window.resource_threads().send(GetCookiesForUrl((*url).clone(), tx, NonHTTP));
|
||||
let _ = self.window
|
||||
.upcast::<GlobalScope>()
|
||||
.resource_threads()
|
||||
.send(GetCookiesForUrl((*url).clone(), tx, NonHTTP));
|
||||
let cookies = rx.recv().unwrap();
|
||||
Ok(cookies.map_or(DOMString::new(), DOMString::from))
|
||||
}
|
||||
|
@ -2745,6 +2748,7 @@ impl DocumentMethods for Document {
|
|||
|
||||
let url = self.url();
|
||||
let _ = self.window
|
||||
.upcast::<GlobalScope>()
|
||||
.resource_threads()
|
||||
.send(SetCookiesForUrl((*url).clone(), String::from(cookie), NonHTTP));
|
||||
Ok(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue