mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-24 19:21:52 +00:00
LibWeb: Use as
to cast global object to WindowOrWorkerGlobalScopeMixin
No functional changes.
This commit is contained in:
parent
3794665b0b
commit
6d7b7e7822
Notes:
github-actions[bot]
2025-02-02 16:19:57 +00:00
Author: https://github.com/tcl3
Commit: 6d7b7e7822
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3428
Reviewed-by: https://github.com/gmta ✅
10 changed files with 30 additions and 44 deletions
|
@ -176,9 +176,8 @@ void EventSource::initialize(JS::Realm& realm)
|
|||
Base::initialize(realm);
|
||||
WEB_SET_PROTOTYPE_FOR_INTERFACE(EventSource);
|
||||
|
||||
auto* relevant_global = dynamic_cast<HTML::WindowOrWorkerGlobalScopeMixin*>(&HTML::relevant_global_object(*this));
|
||||
VERIFY(relevant_global);
|
||||
relevant_global->register_event_source({}, *this);
|
||||
auto& relevant_global = as<HTML::WindowOrWorkerGlobalScopeMixin>(HTML::relevant_global_object(*this));
|
||||
relevant_global.register_event_source({}, *this);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/server-sent-events.html#garbage-collection
|
||||
|
@ -191,9 +190,8 @@ void EventSource::finalize()
|
|||
m_fetch_controller->abort(realm(), {});
|
||||
}
|
||||
|
||||
auto* relevant_global = dynamic_cast<HTML::WindowOrWorkerGlobalScopeMixin*>(&HTML::relevant_global_object(*this));
|
||||
VERIFY(relevant_global);
|
||||
relevant_global->unregister_event_source({}, *this);
|
||||
auto& relevant_global = as<HTML::WindowOrWorkerGlobalScopeMixin>(HTML::relevant_global_object(*this));
|
||||
relevant_global.unregister_event_source({}, *this);
|
||||
}
|
||||
|
||||
void EventSource::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue