diff options
author | Mukilan Thiyagarajan <mukilan@igalia.com> | 2024-05-20 16:05:18 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-20 10:35:18 +0000 |
commit | 2af6fe0b30a275e5fd8a43eca4126d82639fbaa9 (patch) | |
tree | 2687a12c392b30cba7cdcd849133d0d382b79cbe /components/shared/net/image_cache.rs | |
parent | c2076580f352f3c61f90969e03d78ada609935eb (diff) | |
download | servo-2af6fe0b30a275e5fd8a43eca4126d82639fbaa9.tar.gz servo-2af6fe0b30a275e5fd8a43eca4126d82639fbaa9.zip |
compositor: Move WebRender-ish messages and types to `webrender_traits` (#32315)
* Move WebRender related types to `webrender_traits`
This refactor moves several WebRender related types
from `compositing_traits`, `script_traits` and `net_traits`
crates to the `webrender_traits` crate.
This change also moves the `Image` type and associated
function out of `net_traits` and into the `pixels` crate.
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Move `script_traits::WebrenderIpcSender` to `webrender_traits::WebRenderScriptApi`
---------
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components/shared/net/image_cache.rs')
-rw-r--r-- | components/shared/net/image_cache.rs | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/components/shared/net/image_cache.rs b/components/shared/net/image_cache.rs index d1087bace63..317fd1b66ef 100644 --- a/components/shared/net/image_cache.rs +++ b/components/shared/net/image_cache.rs @@ -7,12 +7,13 @@ use std::sync::Arc; use ipc_channel::ipc::IpcSender; use log::debug; use malloc_size_of_derive::MallocSizeOf; +use pixels::{Image, ImageMetadata}; use serde::{Deserialize, Serialize}; use servo_url::{ImmutableOrigin, ServoUrl}; +use webrender_traits::WebRenderNetApi; -use crate::image::base::{Image, ImageMetadata}; use crate::request::CorsSettings; -use crate::{FetchResponseMsg, WebrenderIpcSender}; +use crate::FetchResponseMsg; // ====================================================================== // Aux structs and enums. @@ -98,7 +99,7 @@ pub enum ImageCacheResult { } pub trait ImageCache: Sync + Send { - fn new(webrender_api: WebrenderIpcSender) -> Self + fn new(webrender_api: WebRenderNetApi) -> Self where Self: Sized; @@ -140,14 +141,3 @@ pub trait ImageCache: Sync + Send { /// Inform the image cache about a response for a pending request. fn notify_pending_response(&self, id: PendingImageId, action: FetchResponseMsg); } - -/// Whether this response passed any CORS checks, and is thus safe to read from -/// in cross-origin environments. -#[derive(Clone, Copy, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)] -pub enum CorsStatus { - /// The response is either same-origin or cross-origin but passed CORS checks. - Safe, - /// The response is cross-origin and did not pass CORS checks. It is unsafe - /// to expose pixel data to the requesting environment. - Unsafe, -} |