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

@ -494,15 +494,13 @@ impl CoreResourceManager {
blocked_content: BLOCKED_CONTENT_RULES.clone(),
};
spawn_named(format!("fetch thread for {}", init.url), move || {
let sync = init.synchronous;
let request = Request::from_init(init);
// XXXManishearth: Check origin against pipeline id
// todo load context / mimesniff in fetch
// todo referrer policy?
// todo service worker stuff
let mut target = Some(Box::new(sender) as Box<FetchTaskTarget + Send + 'static>);
let response = fetch(Rc::new(request), &mut target, http_state);
target.unwrap().fetch_done(&response, sync);
fetch(Rc::new(request), &mut target, http_state);
})
}