ladybird/Libraries/LibWeb/Fetch/Infrastructure/FetchRecord.cpp
Shannon Booth f87041bf3a LibGC+Everywhere: Factor out a LibGC from LibJS
Resulting in a massive rename across almost everywhere! Alongside the
namespace change, we now have the following names:

 * JS::NonnullGCPtr -> GC::Ref
 * JS::GCPtr -> GC::Ptr
 * JS::HeapFunction -> GC::Function
 * JS::CellImpl -> GC::Cell
 * JS::Handle -> GC::Root
2024-11-15 14:49:20 +01:00

41 lines
1.1 KiB
C++

/*
* 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 {
GC_DEFINE_ALLOCATOR(FetchRecord);
GC::Ref<FetchRecord> FetchRecord::create(JS::VM& vm, GC::Ref<Infrastructure::Request> request)
{
return vm.heap().allocate<FetchRecord>(request);
}
GC::Ref<FetchRecord> FetchRecord::create(JS::VM& vm, GC::Ref<Infrastructure::Request> request, GC::Ptr<Fetch::Infrastructure::FetchController> fetch_controller)
{
return vm.heap().allocate<FetchRecord>(request, fetch_controller);
}
FetchRecord::FetchRecord(GC::Ref<Infrastructure::Request> request)
: m_request(request)
{
}
FetchRecord::FetchRecord(GC::Ref<Infrastructure::Request> request, GC::Ptr<Fetch::Infrastructure::FetchController> fetch_controller)
: 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);
}
}