LibWeb: Fix some GCVerifier warnings

This commit is contained in:
Matthew Olsson 2024-04-05 13:47:48 -07:00 committed by Andreas Kling
commit 8450041b52
Notes: sideshowbarker 2024-07-17 06:28:38 +09:00
23 changed files with 63 additions and 59 deletions

View file

@ -888,7 +888,7 @@ void HTMLFormElement::plan_to_navigate_to(URL::URL url, Variant<Empty, String, P
// NOTE: `this`, `actual_resource` and `target_navigable` are protected by JS::SafeFunction.
queue_an_element_task(Task::Source::DOMManipulation, [this, url, post_resource, target_navigable, history_handling, referrer_policy, user_involvement]() {
// 1. Set the form's planned navigation to null.
m_planned_navigation = nullptr;
m_planned_navigation = {};
// 2. Navigate targetNavigable to url using the form element's node document, with historyHandling set to historyHandling,
// referrerPolicy set to referrerPolicy, documentResource set to postResource, and cspNavigationType set to "form-submission".

View file

@ -142,7 +142,7 @@ private:
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#planned-navigation
// Each form element has a planned navigation, which is either null or a task; when the form is first created,
// its planned navigation must be set to null.
Task const* m_planned_navigation { nullptr };
JS::GCPtr<Task const> m_planned_navigation;
};
}

View file

@ -13,16 +13,16 @@ TemporaryExecutionContext::TemporaryExecutionContext(EnvironmentSettingsObject&
: m_environment_settings(environment_settings)
, m_callbacks_enabled(callbacks_enabled)
{
m_environment_settings.prepare_to_run_script();
m_environment_settings->prepare_to_run_script();
if (m_callbacks_enabled == CallbacksEnabled::Yes)
m_environment_settings.prepare_to_run_callback();
m_environment_settings->prepare_to_run_callback();
}
TemporaryExecutionContext::~TemporaryExecutionContext()
{
m_environment_settings.clean_up_after_running_script();
m_environment_settings->clean_up_after_running_script();
if (m_callbacks_enabled == CallbacksEnabled::Yes)
m_environment_settings.clean_up_after_running_callback();
m_environment_settings->clean_up_after_running_callback();
}
}

View file

@ -24,7 +24,7 @@ public:
~TemporaryExecutionContext();
private:
EnvironmentSettingsObject& m_environment_settings;
JS::NonnullGCPtr<EnvironmentSettingsObject> m_environment_settings;
CallbacksEnabled m_callbacks_enabled { CallbacksEnabled::No };
};