mirror of
https://github.com/servo/servo.git
synced 2025-09-23 13:20:11 +01:00
constellation: Migrate namespace channel to GenericChannel (#38913)
Migrates the namespace sender and receiver to use GenericChannel Testing: Covered by existing tests Part of #38912 Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This commit is contained in:
parent
e21ea2a135
commit
cf13fd4628
3 changed files with 13 additions and 14 deletions
|
@ -99,7 +99,7 @@ use background_hang_monitor::HangMonitorRegister;
|
|||
use background_hang_monitor_api::{
|
||||
BackgroundHangMonitorControlMsg, BackgroundHangMonitorRegister, HangMonitorAlert,
|
||||
};
|
||||
use base::generic_channel::GenericSender;
|
||||
use base::generic_channel::{GenericSender, RoutedReceiver};
|
||||
use base::id::{
|
||||
BrowsingContextGroupId, BrowsingContextId, HistoryStateId, MessagePortId, MessagePortRouterId,
|
||||
PipelineId, PipelineNamespace, PipelineNamespaceId, PipelineNamespaceRequest, WebViewId,
|
||||
|
@ -284,8 +284,8 @@ pub struct Constellation<STF, SWF> {
|
|||
/// An ipc-sender/threaded-receiver pair
|
||||
/// to facilitate installing pipeline namespaces in threads
|
||||
/// via a per-process installer.
|
||||
namespace_receiver: Receiver<Result<PipelineNamespaceRequest, IpcError>>,
|
||||
namespace_ipc_sender: IpcSender<PipelineNamespaceRequest>,
|
||||
namespace_receiver: RoutedReceiver<PipelineNamespaceRequest>,
|
||||
namespace_ipc_sender: GenericSender<PipelineNamespaceRequest>,
|
||||
|
||||
/// An IPC channel for script threads to send messages to the constellation.
|
||||
/// This is the script threads' view of `script_receiver`.
|
||||
|
@ -293,7 +293,7 @@ pub struct Constellation<STF, SWF> {
|
|||
|
||||
/// A channel for the constellation to receive messages from script threads.
|
||||
/// This is the constellation's view of `script_sender`.
|
||||
script_receiver: generic_channel::RoutedReceiver<(PipelineId, ScriptToConstellationMessage)>,
|
||||
script_receiver: RoutedReceiver<(PipelineId, ScriptToConstellationMessage)>,
|
||||
|
||||
/// A handle to register components for hang monitoring.
|
||||
/// None when in multiprocess mode.
|
||||
|
@ -610,11 +610,8 @@ where
|
|||
let script_receiver = script_ipc_receiver.route_preserving_errors();
|
||||
|
||||
let (namespace_ipc_sender, namespace_ipc_receiver) =
|
||||
ipc::channel().expect("ipc channel failure");
|
||||
let namespace_receiver =
|
||||
route_ipc_receiver_to_new_crossbeam_receiver_preserving_errors(
|
||||
namespace_ipc_receiver,
|
||||
);
|
||||
generic_channel::channel().expect("ipc channel failure");
|
||||
let namespace_receiver = namespace_ipc_receiver.route_preserving_errors();
|
||||
|
||||
let (background_hang_monitor_ipc_sender, background_hang_monitor_ipc_receiver) =
|
||||
ipc::channel().expect("ipc channel failure");
|
||||
|
|
|
@ -132,7 +132,7 @@ pub struct InitialPipelineState {
|
|||
pub script_to_constellation_chan: ScriptToConstellationChan,
|
||||
|
||||
/// A sender to request pipeline namespace ids.
|
||||
pub namespace_request_sender: IpcSender<PipelineNamespaceRequest>,
|
||||
pub namespace_request_sender: GenericSender<PipelineNamespaceRequest>,
|
||||
|
||||
/// A handle to register components for hang monitoring.
|
||||
/// None when in multiprocess mode.
|
||||
|
@ -470,7 +470,7 @@ pub struct UnprivilegedPipelineContent {
|
|||
browsing_context_id: BrowsingContextId,
|
||||
parent_pipeline_id: Option<PipelineId>,
|
||||
opener: Option<BrowsingContextId>,
|
||||
namespace_request_sender: IpcSender<PipelineNamespaceRequest>,
|
||||
namespace_request_sender: GenericSender<PipelineNamespaceRequest>,
|
||||
script_to_constellation_chan: ScriptToConstellationChan,
|
||||
background_hang_monitor_to_constellation_chan: IpcSender<HangMonitorAlert>,
|
||||
bhm_control_port: Option<IpcReceiver<BackgroundHangMonitorControlMsg>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue