base: Migrate PipelineNameSpaceInstaller to GenericChannel (#39073)

Testing: Covered by existing tests
Part of #38912

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This commit is contained in:
Jonathan Schwender 2025-09-01 19:23:16 +02:00 committed by GitHub
parent eece4c24b0
commit 93aeac056b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,14 +12,13 @@ use std::marker::PhantomData;
use std::num::NonZeroU32; use std::num::NonZeroU32;
use std::sync::{Arc, LazyLock}; use std::sync::{Arc, LazyLock};
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use malloc_size_of::MallocSizeOfOps; use malloc_size_of::MallocSizeOfOps;
use malloc_size_of_derive::MallocSizeOf; use malloc_size_of_derive::MallocSizeOf;
use parking_lot::Mutex; use parking_lot::Mutex;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use webrender_api::{ExternalScrollId, PipelineId as WebRenderPipelineId}; use webrender_api::{ExternalScrollId, PipelineId as WebRenderPipelineId};
use crate::generic_channel::GenericSender; use crate::generic_channel::{self, GenericReceiver, GenericSender};
/// Asserts the size of a type at compile time. /// Asserts the size of a type at compile time.
macro_rules! size_of_test { macro_rules! size_of_test {
@ -117,19 +116,19 @@ macro_rules! namespace_id {
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
/// Request a pipeline-namespace id from the constellation. /// Request a pipeline-namespace id from the constellation.
pub struct PipelineNamespaceRequest(pub IpcSender<PipelineNamespaceId>); pub struct PipelineNamespaceRequest(pub GenericSender<PipelineNamespaceId>);
/// A per-process installer of pipeline-namespaces. /// A per-process installer of pipeline-namespaces.
pub struct PipelineNamespaceInstaller { pub struct PipelineNamespaceInstaller {
request_sender: Option<GenericSender<PipelineNamespaceRequest>>, request_sender: Option<GenericSender<PipelineNamespaceRequest>>,
namespace_sender: IpcSender<PipelineNamespaceId>, namespace_sender: GenericSender<PipelineNamespaceId>,
namespace_receiver: IpcReceiver<PipelineNamespaceId>, namespace_receiver: GenericReceiver<PipelineNamespaceId>,
} }
impl Default for PipelineNamespaceInstaller { impl Default for PipelineNamespaceInstaller {
fn default() -> Self { fn default() -> Self {
let (namespace_sender, namespace_receiver) = let (namespace_sender, namespace_receiver) =
ipc::channel().expect("PipelineNamespaceInstaller ipc channel failure"); generic_channel::channel().expect("PipelineNamespaceInstaller channel failure");
Self { Self {
request_sender: None, request_sender: None,
namespace_sender, namespace_sender,