summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Fetch/Infrastructure
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-12-14 17:40:33 +0000
committerTim Flynn <trflynn89@pm.me>2022-12-15 06:56:37 -0500
commit22089436edec780e03960ecaa74bfc4930126534 (patch)
treef60662c28d36e8fcce4b734e09af396c68ed1aaf /Userland/Libraries/LibWeb/Fetch/Infrastructure
parent2a66fc6cae8ef09e780cd795bf0b1d7f8844f4ec (diff)
downloadserenity-22089436edec780e03960ecaa74bfc4930126534.zip
LibJS: Convert Heap::allocate{,_without_realm}() to NonnullGCPtr
Diffstat (limited to 'Userland/Libraries/LibWeb/Fetch/Infrastructure')
-rw-r--r--Userland/Libraries/LibWeb/Fetch/Infrastructure/ConnectionTimingInfo.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchAlgorithms.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchController.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchParams.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchTimingInfo.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Bodies.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Headers.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.cpp10
9 files changed, 13 insertions, 13 deletions
diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/ConnectionTimingInfo.cpp b/Userland/Libraries/LibWeb/Fetch/Infrastructure/ConnectionTimingInfo.cpp
index 3658690981..9f4e968a74 100644
--- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/ConnectionTimingInfo.cpp
+++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/ConnectionTimingInfo.cpp
@@ -14,7 +14,7 @@ ConnectionTimingInfo::ConnectionTimingInfo() = default;
JS::NonnullGCPtr<ConnectionTimingInfo> ConnectionTimingInfo::create(JS::VM& vm)
{
- return { *vm.heap().allocate_without_realm<ConnectionTimingInfo>() };
+ return vm.heap().allocate_without_realm<ConnectionTimingInfo>();
}
}
diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchAlgorithms.cpp b/Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchAlgorithms.cpp
index 22e0ebe5a6..a353a3197d 100644
--- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchAlgorithms.cpp
+++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchAlgorithms.cpp
@@ -12,7 +12,7 @@ namespace Web::Fetch::Infrastructure {
JS::NonnullGCPtr<FetchAlgorithms> FetchAlgorithms::create(JS::VM& vm, Input input)
{
- return { *vm.heap().allocate_without_realm<FetchAlgorithms>(move(input)) };
+ return vm.heap().allocate_without_realm<FetchAlgorithms>(move(input));
}
FetchAlgorithms::FetchAlgorithms(Input input)
diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchController.cpp b/Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchController.cpp
index 451de59ec0..b26a01d80f 100644
--- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchController.cpp
+++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchController.cpp
@@ -15,7 +15,7 @@ FetchController::FetchController() = default;
JS::NonnullGCPtr<FetchController> FetchController::create(JS::VM& vm)
{
- return { *vm.heap().allocate_without_realm<FetchController>() };
+ return vm.heap().allocate_without_realm<FetchController>();
}
void FetchController::visit_edges(JS::Cell::Visitor& visitor)
diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchParams.cpp b/Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchParams.cpp
index 257c42869d..cf395ff7ad 100644
--- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchParams.cpp
+++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchParams.cpp
@@ -23,7 +23,7 @@ JS::NonnullGCPtr<FetchParams> FetchParams::create(JS::VM& vm, JS::NonnullGCPtr<R
{
auto algorithms = Infrastructure::FetchAlgorithms::create(vm, {});
auto controller = Infrastructure::FetchController::create(vm);
- return { *vm.heap().allocate_without_realm<FetchParams>(request, algorithms, controller, timing_info) };
+ return vm.heap().allocate_without_realm<FetchParams>(request, algorithms, controller, timing_info);
}
void FetchParams::visit_edges(JS::Cell::Visitor& visitor)
diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchTimingInfo.cpp b/Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchTimingInfo.cpp
index 0e4a43adda..562ad4ff9d 100644
--- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchTimingInfo.cpp
+++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchTimingInfo.cpp
@@ -14,7 +14,7 @@ FetchTimingInfo::FetchTimingInfo() = default;
JS::NonnullGCPtr<FetchTimingInfo> FetchTimingInfo::create(JS::VM& vm)
{
- return { *vm.heap().allocate_without_realm<FetchTimingInfo>() };
+ return vm.heap().allocate_without_realm<FetchTimingInfo>();
}
void FetchTimingInfo::visit_edges(JS::Cell::Visitor& visitor)
diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Bodies.cpp b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Bodies.cpp
index 475da2f53f..806c867b96 100644
--- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Bodies.cpp
+++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Bodies.cpp
@@ -34,7 +34,7 @@ WebIDL::ExceptionOr<Body> Body::clone() const
// FIXME: 1. Let « out1, out2 » be the result of teeing body’s stream.
// FIXME: 2. Set body’s stream to out1.
- auto* out2 = vm.heap().allocate<Streams::ReadableStream>(realm, realm);
+ auto out2 = vm.heap().allocate<Streams::ReadableStream>(realm, realm);
// 3. Return a body whose stream is out2 and other members are copied from body.
return Body { JS::make_handle(out2), m_source, m_length };
diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Headers.cpp b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Headers.cpp
index 5ab9841ae1..b6862eb63e 100644
--- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Headers.cpp
+++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Headers.cpp
@@ -48,7 +48,7 @@ ErrorOr<Header> Header::from_string_pair(StringView name, StringView value)
JS::NonnullGCPtr<HeaderList> HeaderList::create(JS::VM& vm)
{
- return { *vm.heap().allocate_without_realm<HeaderList>() };
+ return vm.heap().allocate_without_realm<HeaderList>();
}
// https://fetch.spec.whatwg.org/#header-list-contains
diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.cpp b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.cpp
index 7e7da22c9d..a8bdd656a1 100644
--- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.cpp
+++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.cpp
@@ -28,7 +28,7 @@ void Request::visit_edges(JS::Cell::Visitor& visitor)
JS::NonnullGCPtr<Request> Request::create(JS::VM& vm)
{
- return { *vm.heap().allocate_without_realm<Request>(HeaderList::create(vm)) };
+ return vm.heap().allocate_without_realm<Request>(HeaderList::create(vm));
}
// https://fetch.spec.whatwg.org/#concept-request-url
diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.cpp b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.cpp
index edf487e4b9..f3238163cc 100644
--- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.cpp
+++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.cpp
@@ -29,7 +29,7 @@ void Response::visit_edges(JS::Cell::Visitor& visitor)
JS::NonnullGCPtr<Response> Response::create(JS::VM& vm)
{
- return { *vm.heap().allocate_without_realm<Response>(HeaderList::create(vm)) };
+ return vm.heap().allocate_without_realm<Response>(HeaderList::create(vm));
}
// https://fetch.spec.whatwg.org/#ref-for-concept-network-error%E2%91%A3
@@ -193,7 +193,7 @@ ErrorOr<JS::NonnullGCPtr<BasicFilteredResponse>> BasicFilteredResponse::create(J
TRY(header_list->append(header));
}
- return { *vm.heap().allocate_without_realm<BasicFilteredResponse>(internal_response, header_list) };
+ return vm.heap().allocate_without_realm<BasicFilteredResponse>(internal_response, header_list);
}
BasicFilteredResponse::BasicFilteredResponse(JS::NonnullGCPtr<Response> internal_response, JS::NonnullGCPtr<HeaderList> header_list)
@@ -223,7 +223,7 @@ ErrorOr<JS::NonnullGCPtr<CORSFilteredResponse>> CORSFilteredResponse::create(JS:
TRY(header_list->append(header));
}
- return { *vm.heap().allocate_without_realm<CORSFilteredResponse>(internal_response, header_list) };
+ return vm.heap().allocate_without_realm<CORSFilteredResponse>(internal_response, header_list);
}
CORSFilteredResponse::CORSFilteredResponse(JS::NonnullGCPtr<Response> internal_response, JS::NonnullGCPtr<HeaderList> header_list)
@@ -242,7 +242,7 @@ JS::NonnullGCPtr<OpaqueFilteredResponse> OpaqueFilteredResponse::create(JS::VM&
{
// An opaque filtered response is a filtered response whose type is "opaque", URL list is the empty list,
// status is 0, status message is the empty byte sequence, header list is empty, and body is null.
- return { *vm.heap().allocate_without_realm<OpaqueFilteredResponse>(internal_response, HeaderList::create(vm)) };
+ return vm.heap().allocate_without_realm<OpaqueFilteredResponse>(internal_response, HeaderList::create(vm));
}
OpaqueFilteredResponse::OpaqueFilteredResponse(JS::NonnullGCPtr<Response> internal_response, JS::NonnullGCPtr<HeaderList> header_list)
@@ -261,7 +261,7 @@ JS::NonnullGCPtr<OpaqueRedirectFilteredResponse> OpaqueRedirectFilteredResponse:
{
// An opaque-redirect filtered response is a filtered response whose type is "opaqueredirect",
// status is 0, status message is the empty byte sequence, header list is empty, and body is null.
- return { *vm.heap().allocate_without_realm<OpaqueRedirectFilteredResponse>(internal_response, HeaderList::create(vm)) };
+ return vm.heap().allocate_without_realm<OpaqueRedirectFilteredResponse>(internal_response, HeaderList::create(vm));
}
OpaqueRedirectFilteredResponse::OpaqueRedirectFilteredResponse(JS::NonnullGCPtr<Response> internal_response, JS::NonnullGCPtr<HeaderList> header_list)