Remove EventLoopWaker from Constellation (#30101)

* remove event_loop_waker that is always None

* remove None event_loop_waker form InitialScriptState

* fix formatting

* remove None event_loop_waker from ScriptThread

* remove None EventLoopWaker from Window

* remove None and use of wake_after_send in webgl code
This commit is contained in:
Atbrakhi 2023-08-15 20:02:02 +02:00 committed by GitHub
parent 83a46f68db
commit 8255e8e318
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 15 additions and 78 deletions

View file

@ -371,11 +371,6 @@ pub struct Window {
#[no_trace]
player_context: WindowGLContext,
/// A mechanism to force the compositor to process events.
#[ignore_malloc_size_of = "traits are cumbersome"]
#[no_trace]
event_loop_waker: Option<Box<dyn EventLoopWaker>>,
visible: Cell<bool>,
/// A shared marker for the validity of any cached layout values. A value of true
@ -514,7 +509,7 @@ impl Window {
pub(crate) fn webgl_chan(&self) -> Option<WebGLCommandSender> {
self.webgl_chan
.as_ref()
.map(|chan| WebGLCommandSender::new(chan.clone(), self.get_event_loop_waker()))
.map(|chan| WebGLCommandSender::new(chan.clone()))
}
pub fn webxr_registry(&self) -> webxr_api::Registry {
@ -570,10 +565,6 @@ impl Window {
self.player_context.clone()
}
pub fn get_event_loop_waker(&self) -> Option<Box<dyn EventLoopWaker>> {
self.event_loop_waker.as_ref().map(|w| (*w).clone_box())
}
// see note at https://dom.spec.whatwg.org/#concept-event-dispatch step 2
pub fn dispatch_event_with_target_override(&self, event: &Event) -> EventStatus {
if self.has_document() {
@ -2587,7 +2578,6 @@ impl Window {
replace_surrogates: bool,
user_agent: Cow<'static, str>,
player_context: WindowGLContext,
event_loop_waker: Option<Box<dyn EventLoopWaker>>,
gpu_id_hub: Arc<ParkMutex<Identities>>,
inherited_secure_context: Option<bool>,
) -> DomRoot<Self> {
@ -2673,7 +2663,6 @@ impl Window {
userscripts_path,
replace_surrogates,
player_context,
event_loop_waker,
visible: Cell::new(true),
layout_marker: DomRefCell::new(Rc::new(Cell::new(true))),
current_event: DomRefCell::new(None),