Re-add support for fetching chunks (and thus xhr download progress)

This commit is contained in:
Manish Goregaokar 2016-06-03 18:37:26 +05:30
parent 6e29b872d7
commit bf99e73cb0
5 changed files with 96 additions and 87 deletions

View file

@ -41,11 +41,11 @@ impl FetchTaskTarget for FetchResponseCollector {
fn process_request_body(&mut self, _: &Request) {}
fn process_request_eof(&mut self, _: &Request) {}
fn process_response(&mut self, _: &Response) {}
fn process_response_chunk(&mut self, _: Vec<u8>) {}
/// Fired when the response is fully fetched
fn process_response_eof(&mut self, response: &Response) {
self.sender.send(response.clone());
}
fn fetch_done(&mut self, _: &Response, _: bool) {}
}
fn fetch_async(request: Request, target: Box<FetchTaskTarget + Send>) {