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:
parent
0ae5c070c7
commit
d277ac72e6
2 changed files with 7 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue