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

@ -24,7 +24,6 @@ use net_traits::{
};
use servo_atoms::Atom;
use servo_url::ServoUrl;
use utf8;
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::EventSourceBinding::{
@ -61,7 +60,7 @@ enum ReadyState {
}
#[dom_struct]
pub struct EventSource {
pub(crate) struct EventSource {
eventtarget: EventTarget,
#[no_trace]
url: ServoUrl,
@ -482,13 +481,13 @@ impl EventSource {
}
// https://html.spec.whatwg.org/multipage/#sse-processing-model:fail-the-connection-3
pub fn cancel(&self) {
pub(crate) fn cancel(&self) {
self.canceller.borrow_mut().cancel();
self.fail_the_connection();
}
/// <https://html.spec.whatwg.org/multipage/#fail-the-connection>
pub fn fail_the_connection(&self) {
pub(crate) fn fail_the_connection(&self) {
let global = self.global();
let event_source = Trusted::new(self);
global.task_manager().remote_event_task_source().queue(
@ -502,11 +501,11 @@ impl EventSource {
);
}
pub fn request(&self) -> RequestBuilder {
pub(crate) fn request(&self) -> RequestBuilder {
self.request.borrow().clone().unwrap()
}
pub fn url(&self) -> &ServoUrl {
pub(crate) fn url(&self) -> &ServoUrl {
&self.url
}
}
@ -649,7 +648,7 @@ impl EventSourceMethods<crate::DomTypeHolder> for EventSource {
}
#[derive(JSTraceable, MallocSizeOf)]
pub struct EventSourceTimeoutCallback {
pub(crate) struct EventSourceTimeoutCallback {
#[ignore_malloc_size_of = "Because it is non-owning"]
event_source: Trusted<EventSource>,
#[ignore_malloc_size_of = "Because it is non-owning"]
@ -659,7 +658,7 @@ pub struct EventSourceTimeoutCallback {
impl EventSourceTimeoutCallback {
// https://html.spec.whatwg.org/multipage/#reestablish-the-connection
pub fn invoke(self) {
pub(crate) fn invoke(self) {
let event_source = self.event_source.root();
let global = event_source.global();
// Step 5.1