mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:27:35 +00:00
LibWeb: Move setting of Web object prototypes to initialize()
This needs to happen before prototype/constructor intitialization can be made lazy. Otherwise, GC could run during the C++ constructor and try to collect the object currently being created.
This commit is contained in:
parent
7bd8fd000f
commit
834202aeb9
339 changed files with 1294 additions and 187 deletions
|
@ -29,8 +29,6 @@ CSSImportRule::CSSImportRule(AK::URL url, DOM::Document& document)
|
|||
, m_url(move(url))
|
||||
, m_document(document)
|
||||
{
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::CSSImportRulePrototype>(document.realm(), "CSSImportRule"));
|
||||
|
||||
dbgln_if(CSS_LOADER_DEBUG, "CSSImportRule: Loading import URL: {}", m_url);
|
||||
auto request = LoadRequest::create_for_url_on_page(m_url, document.page());
|
||||
|
||||
|
@ -41,6 +39,12 @@ CSSImportRule::CSSImportRule(AK::URL url, DOM::Document& document)
|
|||
set_resource(ResourceLoader::the().load_resource(Resource::Type::Generic, request));
|
||||
}
|
||||
|
||||
void CSSImportRule::initialize(JS::Realm& realm)
|
||||
{
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::CSSImportRulePrototype>(realm, "CSSImportRule"));
|
||||
}
|
||||
|
||||
void CSSImportRule::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue