1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:08:11 +00:00

LibWeb: Make SharedImageRequest store Page member as NonnullGCPtr

This allows us to remove one raw Web::Page& member. Or rather, it
becomes a JS::NonnullGCPtr that we trace like anything else. :^)

Co-Authored-By: Andreas Kling <kling@serenityos.org>
This commit is contained in:
Shannon Booth 2023-12-04 21:59:00 +13:00 committed by Andreas Kling
parent 0ae5c070c7
commit d277ac72e6
2 changed files with 7 additions and 5 deletions

View file

@ -22,7 +22,7 @@ class SharedImageRequest : public JS::Cell {
JS_DECLARE_ALLOCATOR(SharedImageRequest);
public:
[[nodiscard]] static JS::NonnullGCPtr<SharedImageRequest> get_or_create(JS::Realm&, Page&, AK::URL const&);
[[nodiscard]] static JS::NonnullGCPtr<SharedImageRequest> get_or_create(JS::Realm&, JS::NonnullGCPtr<Page>, AK::URL const&);
~SharedImageRequest();
@ -43,7 +43,7 @@ public:
virtual void visit_edges(JS::Cell::Visitor&) override;
private:
explicit SharedImageRequest(Page&, AK::URL, JS::NonnullGCPtr<DOM::Document>);
explicit SharedImageRequest(JS::NonnullGCPtr<Page>, AK::URL, JS::NonnullGCPtr<DOM::Document>);
void handle_successful_fetch(AK::URL const&, StringView mime_type, ByteBuffer data);
void handle_failed_fetch();
@ -57,7 +57,7 @@ private:
State m_state { State::New };
Page& m_page;
JS::NonnullGCPtr<Page> m_page;
struct Callbacks {
JS::GCPtr<JS::HeapFunction<void()>> on_finish;