1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:17:46 +00:00

LibJS+LibWeb: Wrap raw JS::Cell*/& fields in GCPtr/NonnullGCPtr

This commit is contained in:
Matthew Olsson 2023-02-26 16:09:02 -07:00 committed by Andreas Kling
parent 1df3652e27
commit 7c0c1c8f49
214 changed files with 825 additions and 827 deletions

View file

@ -157,8 +157,8 @@ public:
using OriginType = Variant<Origin, HTML::Origin>;
using PolicyContainerType = Variant<PolicyContainer, HTML::PolicyContainer>;
using ReferrerType = Variant<Referrer, AK::URL>;
using ReservedClientType = Variant<Empty, HTML::Environment*, HTML::EnvironmentSettingsObject*>;
using WindowType = Variant<Window, HTML::EnvironmentSettingsObject*>;
using ReservedClientType = Variant<Empty, JS::GCPtr<HTML::Environment>, JS::GCPtr<HTML::EnvironmentSettingsObject>>;
using WindowType = Variant<Window, JS::GCPtr<HTML::EnvironmentSettingsObject>>;
[[nodiscard]] static JS::NonnullGCPtr<Request> create(JS::VM&);
@ -178,8 +178,8 @@ public:
[[nodiscard]] BodyType& body() { return m_body; }
void set_body(BodyType body) { m_body = move(body); }
[[nodiscard]] HTML::EnvironmentSettingsObject const* client() const { return m_client; }
[[nodiscard]] HTML::EnvironmentSettingsObject* client() { return m_client; }
[[nodiscard]] JS::GCPtr<HTML::EnvironmentSettingsObject const> client() const { return m_client; }
[[nodiscard]] JS::GCPtr<HTML::EnvironmentSettingsObject> client() { return m_client; }
void set_client(HTML::EnvironmentSettingsObject* client) { m_client = client; }
[[nodiscard]] ReservedClientType const& reserved_client() const { return m_reserved_client; }
@ -343,7 +343,7 @@ private:
// https://fetch.spec.whatwg.org/#concept-request-client
// A request has an associated client (null or an environment settings object).
HTML::EnvironmentSettingsObject* m_client { nullptr };
JS::GCPtr<HTML::EnvironmentSettingsObject> m_client;
// https://fetch.spec.whatwg.org/#concept-request-reserved-client
// A request has an associated reserved client (null, an environment, or an environment settings object). Unless