Add fetch_async to PendingAsyncLoad, DocumentLoader and Document

This commit is contained in:
Keith Yeung 2016-07-16 12:33:40 -07:00
parent 2bb95989c5
commit d4816762fa
3 changed files with 32 additions and 3 deletions

View file

@ -520,6 +520,13 @@ impl PendingAsyncLoad {
let consumer = LoadConsumer::Listener(listener);
self.core_resource_thread.send(CoreResourceMsg::Load(load_data, consumer, None)).unwrap();
}
/// Initiate the fetch associated with this pending load.
pub fn fetch_async(mut self, request: RequestInit, fetch_target: IpcSender<FetchResponseMsg>) {
self.guard.neuter();
self.core_resource_thread.send(CoreResourceMsg::Fetch(request, fetch_target)).unwrap();
}
}
/// Message sent in response to `Load`. Contains metadata, and a port