Extract layout image request into separate file. Do not block the document load event.

This commit is contained in:
Josh Matthews 2017-01-10 15:05:17 -05:00
parent 0d2ec852ac
commit b363371339
4 changed files with 92 additions and 72 deletions

View file

@ -116,6 +116,13 @@ impl DocumentLoader {
request: RequestInit,
fetch_target: IpcSender<FetchResponseMsg>) {
self.add_blocking_load(load);
self.fetch_async_background(request, fetch_target);
}
/// Initiate a new fetch that does not block the document load event.
pub fn fetch_async_background(&mut self,
request: RequestInit,
fetch_target: IpcSender<FetchResponseMsg>) {
self.resource_threads.sender().send(CoreResourceMsg::Fetch(request, fetch_target)).unwrap();
}