diff options
author | Josh Matthews <josh@joshmatthews.net> | 2017-01-10 15:05:17 -0500 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2017-02-22 14:19:35 -0500 |
commit | b3633713392a2754ba2324209cf2db8fadb70110 (patch) | |
tree | fc261486f9fea2391657bd4766f21b34f0df3855 /components/script/document_loader.rs | |
parent | 0d2ec852ac63f3513394df7937bddb72daed8005 (diff) | |
download | servo-b3633713392a2754ba2324209cf2db8fadb70110.tar.gz servo-b3633713392a2754ba2324209cf2db8fadb70110.zip |
Extract layout image request into separate file. Do not block the document load event.
Diffstat (limited to 'components/script/document_loader.rs')
-rw-r--r-- | components/script/document_loader.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/components/script/document_loader.rs b/components/script/document_loader.rs index 30d83019c5f..a4ce36a2f57 100644 --- a/components/script/document_loader.rs +++ b/components/script/document_loader.rs @@ -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(); } |