mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Remove spin_until from create_navigation_params_by_fetching
This is in similar fashion and reason to e095bf3
This commit is contained in:
parent
ed9c0c1e09
commit
7f7babe735
Notes:
github-actions[bot]
2025-11-07 03:09:35 +00:00
Author: https://github.com/Lubrsi
Commit: 7f7babe735
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6355
Reviewed-by: https://github.com/kalenikaliaksandr ✅
Reviewed-by: https://github.com/trflynn89
5 changed files with 503 additions and 435 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -24,6 +24,7 @@ void NavigationObserver::visit_edges(Cell::Visitor& visitor)
|
|||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_navigable);
|
||||
visitor.visit(m_navigation_complete);
|
||||
visitor.visit(m_ongoing_navigation_changed);
|
||||
}
|
||||
|
||||
void NavigationObserver::finalize()
|
||||
|
|
@ -40,4 +41,12 @@ void NavigationObserver::set_navigation_complete(Function<void()> callback)
|
|||
m_navigation_complete = nullptr;
|
||||
}
|
||||
|
||||
void NavigationObserver::set_ongoing_navigation_changed(Function<void()> callback)
|
||||
{
|
||||
if (callback)
|
||||
m_ongoing_navigation_changed = GC::create_function(vm().heap(), move(callback));
|
||||
else
|
||||
m_ongoing_navigation_changed = nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@ public:
|
|||
[[nodiscard]] GC::Ptr<GC::Function<void()>> navigation_complete() const { return m_navigation_complete; }
|
||||
void set_navigation_complete(Function<void()>);
|
||||
|
||||
[[nodiscard]] GC::Ptr<GC::Function<void()>> ongoing_navigation_changed() const { return m_ongoing_navigation_changed; }
|
||||
void set_ongoing_navigation_changed(Function<void()>);
|
||||
|
||||
private:
|
||||
NavigationObserver(JS::Realm&, Navigable&);
|
||||
|
||||
|
|
@ -31,6 +34,7 @@ private:
|
|||
IntrusiveListNode<NavigationObserver> m_list_node;
|
||||
GC::Ref<Navigable> m_navigable;
|
||||
GC::Ptr<GC::Function<void()>> m_navigation_complete;
|
||||
GC::Ptr<GC::Function<void()>> m_ongoing_navigation_changed;
|
||||
|
||||
public:
|
||||
using NavigationObserversList = IntrusiveList<&NavigationObserver::m_list_node>;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ void NavigationParams::visit_edges(Visitor& visitor)
|
|||
visitor.visit(request);
|
||||
visitor.visit(response);
|
||||
visitor.visit(fetch_controller);
|
||||
visitor.visit(commit_early_hints);
|
||||
visitor.visit(reserved_environment);
|
||||
visitor.visit(policy_container);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ struct NavigationParams : GC::Cell {
|
|||
GC::Ptr<Fetch::Infrastructure::FetchController> fetch_controller { nullptr };
|
||||
|
||||
// null or an algorithm accepting a Document, once it has been created
|
||||
Function<void(DOM::Document&)> commit_early_hints { nullptr };
|
||||
GC::Ptr<GC::Function<void(DOM::Document&)>> commit_early_hints { nullptr };
|
||||
|
||||
// an opener policy enforcement result, used for reporting and potentially for causing a browsing context group switch
|
||||
OpenerPolicyEnforcementResult coop_enforcement_result;
|
||||
|
|
@ -79,7 +79,7 @@ protected:
|
|||
GC::Ptr<Fetch::Infrastructure::Request> request,
|
||||
GC::Ptr<Fetch::Infrastructure::Response> response,
|
||||
GC::Ptr<Fetch::Infrastructure::FetchController> fetch_controller,
|
||||
Function<void(DOM::Document&)> commit_early_hints,
|
||||
GC::Ptr<GC::Function<void(DOM::Document&)>> commit_early_hints,
|
||||
OpenerPolicyEnforcementResult coop_enforcement_result,
|
||||
Fetch::Infrastructure::Request::ReservedClientType reserved_environment,
|
||||
URL::Origin origin,
|
||||
|
|
@ -93,7 +93,7 @@ protected:
|
|||
, request(request)
|
||||
, response(response)
|
||||
, fetch_controller(fetch_controller)
|
||||
, commit_early_hints(move(commit_early_hints))
|
||||
, commit_early_hints(commit_early_hints)
|
||||
, coop_enforcement_result(move(coop_enforcement_result))
|
||||
, reserved_environment(reserved_environment)
|
||||
, origin(move(origin))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue