Introduce GlobalScope::resource_threads

This commit is contained in:
Anthony Ramine 2016-10-03 18:39:03 +02:00
parent 86d2008137
commit bad49e4696
10 changed files with 41 additions and 44 deletions

View file

@ -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(())