2024-07-16 19:19:57 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2024, Mohamed amine Bounya <mobounya@gmail.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <LibWeb/Fetch/Infrastructure/FetchRecord.h>
|
|
|
|
|
|
|
|
namespace Web::Fetch::Infrastructure {
|
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_DEFINE_ALLOCATOR(FetchRecord);
|
2024-07-16 19:19:57 +01:00
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
GC::Ref<FetchRecord> FetchRecord::create(JS::VM& vm, GC::Ref<Infrastructure::Request> request)
|
2024-07-16 19:19:57 +01:00
|
|
|
{
|
2024-11-14 06:13:46 +13:00
|
|
|
return vm.heap().allocate<FetchRecord>(request);
|
2024-07-16 19:19:57 +01:00
|
|
|
}
|
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
GC::Ref<FetchRecord> FetchRecord::create(JS::VM& vm, GC::Ref<Infrastructure::Request> request, GC::Ptr<Fetch::Infrastructure::FetchController> fetch_controller)
|
2024-07-16 19:19:57 +01:00
|
|
|
{
|
2024-11-14 06:13:46 +13:00
|
|
|
return vm.heap().allocate<FetchRecord>(request, fetch_controller);
|
2024-07-16 19:19:57 +01:00
|
|
|
}
|
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
FetchRecord::FetchRecord(GC::Ref<Infrastructure::Request> request)
|
2024-07-16 19:19:57 +01:00
|
|
|
: m_request(request)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
FetchRecord::FetchRecord(GC::Ref<Infrastructure::Request> request, GC::Ptr<Fetch::Infrastructure::FetchController> fetch_controller)
|
2024-07-16 19:19:57 +01:00
|
|
|
: m_request(request)
|
|
|
|
, m_fetch_controller(fetch_controller)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void FetchRecord::visit_edges(Visitor& visitor)
|
|
|
|
{
|
|
|
|
Base::visit_edges(visitor);
|
|
|
|
visitor.visit(m_request);
|
|
|
|
visitor.visit(m_fetch_controller);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|