mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-29 22:42:52 +00:00
LibWeb: Prefer GCPtr<T> over Optional<NonnullGCPtr<T>>
This commit is contained in:
parent
80658743d3
commit
70e2f51674
Notes:
sideshowbarker
2024-07-17 16:23:55 +09:00
Author: https://github.com/shannonbooth
Commit: 70e2f51674
Pull-request: https://github.com/SerenityOS/serenity/pull/23877
Reviewed-by: https://github.com/kennethmyhra ✅
5 changed files with 22 additions and 22 deletions
|
@ -204,7 +204,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Infrastructure::FetchController>> fetch(JS:
|
|||
}
|
||||
|
||||
// https://fetch.spec.whatwg.org/#concept-main-fetch
|
||||
WebIDL::ExceptionOr<Optional<JS::NonnullGCPtr<PendingResponse>>> main_fetch(JS::Realm& realm, Infrastructure::FetchParams const& fetch_params, Recursive recursive)
|
||||
WebIDL::ExceptionOr<JS::GCPtr<PendingResponse>> main_fetch(JS::Realm& realm, Infrastructure::FetchParams const& fetch_params, Recursive recursive)
|
||||
{
|
||||
dbgln_if(WEB_FETCH_DEBUG, "Fetch: Running 'main fetch' with: fetch_params @ {}", &fetch_params);
|
||||
|
||||
|
@ -529,7 +529,7 @@ WebIDL::ExceptionOr<Optional<JS::NonnullGCPtr<PendingResponse>>> main_fetch(JS::
|
|||
});
|
||||
});
|
||||
|
||||
return Optional<JS::NonnullGCPtr<PendingResponse>> {};
|
||||
return JS::GCPtr<PendingResponse> {};
|
||||
}
|
||||
|
||||
// https://fetch.spec.whatwg.org/#fetch-finale
|
||||
|
@ -1013,7 +1013,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_fetch(JS::Realm& rea
|
|||
return;
|
||||
}
|
||||
|
||||
Optional<JS::NonnullGCPtr<PendingResponse>> inner_pending_response;
|
||||
JS::GCPtr<PendingResponse> inner_pending_response;
|
||||
|
||||
// 7. If actualResponse’s status is a redirect status, then:
|
||||
if (Infrastructure::is_redirect_status(actual_response->status())) {
|
||||
|
@ -1053,8 +1053,8 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_fetch(JS::Realm& rea
|
|||
}
|
||||
}
|
||||
|
||||
if (inner_pending_response.has_value()) {
|
||||
inner_pending_response.value()->when_loaded([returned_pending_response](JS::NonnullGCPtr<Infrastructure::Response> response) {
|
||||
if (inner_pending_response) {
|
||||
inner_pending_response->when_loaded([returned_pending_response](JS::NonnullGCPtr<Infrastructure::Response> response) {
|
||||
dbgln_if(WEB_FETCH_DEBUG, "Fetch: Running 'HTTP fetch' inner_pending_response load callback");
|
||||
returned_pending_response->resolve(response);
|
||||
});
|
||||
|
@ -1069,7 +1069,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_fetch(JS::Realm& rea
|
|||
}
|
||||
|
||||
// https://fetch.spec.whatwg.org/#concept-http-redirect-fetch
|
||||
WebIDL::ExceptionOr<Optional<JS::NonnullGCPtr<PendingResponse>>> http_redirect_fetch(JS::Realm& realm, Infrastructure::FetchParams const& fetch_params, Infrastructure::Response& response)
|
||||
WebIDL::ExceptionOr<JS::GCPtr<PendingResponse>> http_redirect_fetch(JS::Realm& realm, Infrastructure::FetchParams const& fetch_params, Infrastructure::Response& response)
|
||||
{
|
||||
dbgln_if(WEB_FETCH_DEBUG, "Fetch: Running 'HTTP-redirect fetch' with: fetch_params @ {}, response = {}", &fetch_params, &response);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue