diff options
Diffstat (limited to 'components/shared/net/lib.rs')
-rw-r--r-- | components/shared/net/lib.rs | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/components/shared/net/lib.rs b/components/shared/net/lib.rs index 436ccf5d645..595d47c7b06 100644 --- a/components/shared/net/lib.rs +++ b/components/shared/net/lib.rs @@ -16,7 +16,6 @@ use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::router::ROUTER; use ipc_channel::Error as IpcError; use lazy_static::lazy_static; -use log::warn; use malloc_size_of::malloc_size_of_is_0; use malloc_size_of_derive::MallocSizeOf; use mime::Mime; @@ -25,7 +24,6 @@ use rustls::Certificate; use serde::{Deserialize, Serialize}; use servo_rand::RngCore; use servo_url::{ImmutableOrigin, ServoUrl}; -use webrender_api::{ImageData, ImageDescriptor, ImageKey}; use crate::filemanager_thread::FileManagerThreadMsg; use crate::request::{Request, RequestBuilder}; @@ -41,15 +39,6 @@ pub mod request; pub mod response; pub mod storage_thread; -/// Image handling. -/// -/// It may be surprising that this goes in the network crate as opposed to the graphics crate. -/// However, image handling is generally very integrated with the network stack (especially where -/// caching is involved) and as a result it must live in here. -pub mod image { - pub mod base; -} - /// An implementation of the [Fetch specification](https://fetch.spec.whatwg.org/) pub mod fetch { pub mod headers; @@ -829,38 +818,6 @@ pub fn http_percent_encode(bytes: &[u8]) -> String { percent_encoding::percent_encode(bytes, HTTP_VALUE).to_string() } -#[derive(Deserialize, Serialize)] -pub enum NetToCompositorMsg { - AddImage(ImageKey, ImageDescriptor, ImageData), - GenerateImageKey(IpcSender<ImageKey>), -} - -#[derive(Clone, Deserialize, Serialize)] -pub struct WebrenderIpcSender(IpcSender<NetToCompositorMsg>); - -impl WebrenderIpcSender { - pub fn new(sender: IpcSender<NetToCompositorMsg>) -> Self { - Self(sender) - } - - pub fn generate_image_key(&self) -> ImageKey { - let (sender, receiver) = ipc::channel().unwrap(); - self.0 - .send(NetToCompositorMsg::GenerateImageKey(sender)) - .expect("error sending image key generation"); - receiver.recv().expect("error receiving image key result") - } - - pub fn add_image(&self, key: ImageKey, descriptor: ImageDescriptor, data: ImageData) { - if let Err(e) = self - .0 - .send(NetToCompositorMsg::AddImage(key, descriptor, data)) - { - warn!("Error sending image update: {}", e); - } - } -} - lazy_static! { pub static ref PRIVILEGED_SECRET: u32 = servo_rand::ServoRng::default().next_u32(); } |