diff options
author | Josh Matthews <josh@joshmatthews.net> | 2025-01-10 03:19:19 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-10 08:19:19 +0000 |
commit | c94d909a8688589209cdf0c7ae58e40f9b8c411e (patch) | |
tree | 12febf23eed4438249fd4d276c4d8b35dee22a97 /components/script/task_source.rs | |
parent | f220d6d3a52296794cd19935e9e59cc75a179a44 (diff) | |
download | servo-c94d909a8688589209cdf0c7ae58e40f9b8c411e.tar.gz servo-c94d909a8688589209cdf0c7ae58e40f9b8c411e.zip |
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>
Diffstat (limited to 'components/script/task_source.rs')
-rw-r--r-- | components/script/task_source.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/components/script/task_source.rs b/components/script/task_source.rs index 0b9bf41e3be..418dcf5501c 100644 --- a/components/script/task_source.rs +++ b/components/script/task_source.rs @@ -23,7 +23,7 @@ use crate::task_manager::TaskManager; /// Note: When adding or removing a [`TaskSourceName`], be sure to also update the return value of /// [`TaskSourceName::all`]. #[derive(Clone, Copy, Debug, Eq, Hash, JSTraceable, MallocSizeOf, PartialEq)] -pub enum TaskSourceName { +pub(crate) enum TaskSourceName { DOMManipulation, FileReading, HistoryTraversal, @@ -64,7 +64,7 @@ impl From<TaskSourceName> for ScriptThreadEventCategory { } impl TaskSourceName { - pub fn all() -> &'static [TaskSourceName] { + pub(crate) fn all() -> &'static [TaskSourceName] { &[ TaskSourceName::DOMManipulation, TaskSourceName::FileReading, @@ -84,8 +84,8 @@ impl TaskSourceName { } pub(crate) struct TaskSource<'task_manager> { - pub task_manager: &'task_manager TaskManager, - pub name: TaskSourceName, + pub(crate) task_manager: &'task_manager TaskManager, + pub(crate) name: TaskSourceName, } impl TaskSource<'_> { @@ -160,11 +160,11 @@ impl<'task_manager> From<TaskSource<'task_manager>> for SendableTaskSource { #[derive(JSTraceable, MallocSizeOf)] pub(crate) struct SendableTaskSource { - pub sender: ScriptEventLoopSender, + pub(crate) sender: ScriptEventLoopSender, #[no_trace] - pub pipeline_id: PipelineId, - pub name: TaskSourceName, - pub canceller: TaskCanceller, + pub(crate) pipeline_id: PipelineId, + pub(crate) name: TaskSourceName, + pub(crate) canceller: TaskCanceller, } impl SendableTaskSource { |