script: Limit public exports. (#34915)

* script: Restrict reexport visibility of DOM types.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Mass pub->pub(crate) conversion.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Hide existing dead code warnings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix clippy warnings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix unit tests.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix clippy.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* More formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-01-10 03:19:19 -05:00 committed by GitHub
parent f220d6d3a5
commit c94d909a86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
585 changed files with 5411 additions and 5013 deletions

View file

@ -130,7 +130,7 @@ pub(crate) enum MainThreadScriptMsg {
}
/// Common messages used to control the event loops in both the script and the worker
pub enum CommonScriptMsg {
pub(crate) enum CommonScriptMsg {
/// Requests that the script thread measure its memory usage. The results are sent back via the
/// supplied channel.
CollectReports(ReportsChan),
@ -297,68 +297,68 @@ impl OpaqueSender<CommonScriptMsg> for ScriptEventLoopSender {
pub(crate) struct ScriptThreadSenders {
/// A channel to hand out to script thread-based entities that need to be able to enqueue
/// events in the event queue.
pub self_sender: Sender<MainThreadScriptMsg>,
pub(crate) self_sender: Sender<MainThreadScriptMsg>,
/// A handle to the bluetooth thread.
#[no_trace]
pub bluetooth_sender: IpcSender<BluetoothRequest>,
pub(crate) bluetooth_sender: IpcSender<BluetoothRequest>,
/// A [`Sender`] that sends messages to the `Constellation`.
#[no_trace]
pub constellation_sender: IpcSender<ConstellationControlMsg>,
pub(crate) constellation_sender: IpcSender<ConstellationControlMsg>,
/// A [`Sender`] that sends messages to the `Constellation` associated with
/// particular pipelines.
#[no_trace]
pub pipeline_to_constellation_sender: IpcSender<(PipelineId, ScriptMsg)>,
pub(crate) pipeline_to_constellation_sender: IpcSender<(PipelineId, ScriptMsg)>,
/// A sender for layout to communicate to the constellation.
#[no_trace]
pub layout_to_constellation_ipc_sender: IpcSender<LayoutMsg>,
pub(crate) layout_to_constellation_ipc_sender: IpcSender<LayoutMsg>,
/// The [`Sender`] on which messages can be sent to the `ImageCache`.
#[no_trace]
pub image_cache_sender: Sender<ImageCacheMsg>,
pub(crate) image_cache_sender: Sender<ImageCacheMsg>,
/// For providing contact with the time profiler.
#[no_trace]
pub time_profiler_sender: profile_time::ProfilerChan,
pub(crate) time_profiler_sender: profile_time::ProfilerChan,
/// For providing contact with the memory profiler.
#[no_trace]
pub memory_profiler_sender: profile_mem::ProfilerChan,
pub(crate) memory_profiler_sender: profile_mem::ProfilerChan,
/// For providing instructions to an optional devtools server.
#[no_trace]
pub devtools_server_sender: Option<IpcSender<ScriptToDevtoolsControlMsg>>,
pub(crate) devtools_server_sender: Option<IpcSender<ScriptToDevtoolsControlMsg>>,
#[no_trace]
pub devtools_client_to_script_thread_sender: IpcSender<DevtoolScriptControlMsg>,
pub(crate) devtools_client_to_script_thread_sender: IpcSender<DevtoolScriptControlMsg>,
#[no_trace]
pub content_process_shutdown_sender: Sender<()>,
pub(crate) content_process_shutdown_sender: Sender<()>,
}
#[derive(JSTraceable)]
pub(crate) struct ScriptThreadReceivers {
/// A [`Receiver`] that receives messages from the constellation.
#[no_trace]
pub constellation_receiver: Receiver<ConstellationControlMsg>,
pub(crate) constellation_receiver: Receiver<ConstellationControlMsg>,
/// The [`Receiver`] which receives incoming messages from the `ImageCache`.
#[no_trace]
pub image_cache_receiver: Receiver<ImageCacheMsg>,
pub(crate) image_cache_receiver: Receiver<ImageCacheMsg>,
/// For receiving commands from an optional devtools server. Will be ignored if no such server
/// exists. When devtools are not active this will be [`crossbeam_channel::never()`].
#[no_trace]
pub devtools_server_receiver: Receiver<DevtoolScriptControlMsg>,
pub(crate) devtools_server_receiver: Receiver<DevtoolScriptControlMsg>,
/// Receiver to receive commands from optional WebGPU server. When there is no active
/// WebGPU context, this will be [`crossbeam_channel::never()`].
#[no_trace]
#[cfg(feature = "webgpu")]
pub webgpu_receiver: RefCell<Receiver<WebGPUMsg>>,
pub(crate) webgpu_receiver: RefCell<Receiver<WebGPUMsg>>,
}
impl ScriptThreadReceivers {