diff options
author | Linus Groh <mail@linusgroh.de> | 2022-10-30 01:52:07 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-10-30 11:30:23 +0000 |
commit | b1968b8bedbe4266c3a488589e64492955023799 (patch) | |
tree | 5e04e2ac323fa1ebeca28ffb36d3e3499618ec93 /Userland/Libraries/LibWeb/Fetch/Response.h | |
parent | 63122d0276c3e44c005d0c5eaf57f297ecd567f0 (diff) | |
download | serenity-b1968b8bedbe4266c3a488589e64492955023799.zip |
LibWeb: Make Fetch::Infrastructure::{Request,Response,HeaderList} GC'd
This is the way.
On a more serious note, there's no reason to keep adding ref-counted
classes to LibWeb now that the majority of classes is GC'd - it only
adds the risk of discovering some cycle down the line, and forces us to
use handles as we can't visit().
Diffstat (limited to 'Userland/Libraries/LibWeb/Fetch/Response.h')
-rw-r--r-- | Userland/Libraries/LibWeb/Fetch/Response.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/Fetch/Response.h b/Userland/Libraries/LibWeb/Fetch/Response.h index ece9943e53..2c32f65f5f 100644 --- a/Userland/Libraries/LibWeb/Fetch/Response.h +++ b/Userland/Libraries/LibWeb/Fetch/Response.h @@ -31,7 +31,7 @@ class Response final WEB_PLATFORM_OBJECT(Response, Bindings::PlatformObject); public: - static JS::NonnullGCPtr<Response> create(NonnullRefPtr<Infrastructure::Response>, Headers::Guard, JS::Realm&); + static JS::NonnullGCPtr<Response> create(JS::Realm&, JS::NonnullGCPtr<Infrastructure::Response>, Headers::Guard); static WebIDL::ExceptionOr<JS::NonnullGCPtr<Response>> construct_impl(JS::Realm&, Optional<BodyInit> const& body = {}, ResponseInit const& init = {}); virtual ~Response() override; @@ -41,7 +41,7 @@ public: virtual Optional<Infrastructure::Body&> body_impl() override; virtual Optional<Infrastructure::Body const&> body_impl() const override; - [[nodiscard]] NonnullRefPtr<Infrastructure::Response> response() const { return m_response; } + [[nodiscard]] JS::NonnullGCPtr<Infrastructure::Response> response() const { return m_response; } // JS API functions [[nodiscard]] static JS::NonnullGCPtr<Response> error(JS::VM&); @@ -60,7 +60,7 @@ public: using BodyMixin::json; private: - Response(JS::Realm&, NonnullRefPtr<Infrastructure::Response>); + Response(JS::Realm&, JS::NonnullGCPtr<Infrastructure::Response>); virtual void visit_edges(Cell::Visitor&) override; @@ -68,7 +68,7 @@ private: // https://fetch.spec.whatwg.org/#concept-response-response // A Response object has an associated response (a response). - NonnullRefPtr<Infrastructure::Response> m_response; + JS::NonnullGCPtr<Infrastructure::Response> m_response; // https://fetch.spec.whatwg.org/#response-headers // A Response object also has an associated headers (null or a Headers object), initially null. |