mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Auto merge of #14246 - emilio:servo-url, r=SimonSapin
Urlmageddon <!-- Please describe your changes on the following line: --> Still needs a bunch of code in net to be converted in order to get more advantage of this for images and stuff, but meanwhile this should help quite a bit with #13778. Still wanted to get this in. r? @SimonSapin <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14246) <!-- Reviewable:end -->
This commit is contained in:
commit
22aebdf5d4
161 changed files with 1044 additions and 718 deletions
|
@ -341,12 +341,12 @@ pub mod utils {
|
|||
use dom::window::Window;
|
||||
use ipc_channel::ipc;
|
||||
use net_traits::image_cache_thread::{ImageCacheChan, ImageResponse};
|
||||
use url::Url;
|
||||
use servo_url::ServoUrl;
|
||||
|
||||
pub fn request_image_from_cache(window: &Window, url: Url) -> ImageResponse {
|
||||
pub fn request_image_from_cache(window: &Window, url: ServoUrl) -> ImageResponse {
|
||||
let image_cache = window.image_cache_thread();
|
||||
let (response_chan, response_port) = ipc::channel().unwrap();
|
||||
image_cache.request_image(url, ImageCacheChan(response_chan), None);
|
||||
image_cache.request_image(url.into(), ImageCacheChan(response_chan), None);
|
||||
let result = response_port.recv().unwrap();
|
||||
result.image_response
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue