mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Revamp Fetch async handling to use a fetch target and done channels
This commit is contained in:
parent
96f3404928
commit
b5255f011e
5 changed files with 158 additions and 106 deletions
|
@ -132,18 +132,6 @@ impl Response {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn wait_until_done(&self) {
|
||||
match self.response_type {
|
||||
// since these response types can't hold a body, they should be considered done
|
||||
ResponseType::Error | ResponseType::Opaque | ResponseType::OpaqueRedirect => {},
|
||||
_ => {
|
||||
while !self.body.lock().unwrap().is_done() && !self.is_network_error() {
|
||||
// loop until done
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn actual_response(&self) -> &Response {
|
||||
if self.return_internal.get() && self.internal_response.is_some() {
|
||||
&**self.internal_response.as_ref().unwrap()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue