mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-19 10:20:22 +00:00
The Cache and CacheStorage interfaces are quite intertwined. A Cache object can only be created through CacheStorage, so the Cache interface cannot be tested on its own. So adding just this stub will allow implementing the CacheStorage interfaces that create Cache objects. We can then implement the Cache interface piecemeal.
33 lines
719 B
C++
33 lines
719 B
C++
/*
|
|
* Copyright (c) 2026, Tim Flynn <trflynn89@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibWeb/Bindings/CachePrototype.h>
|
|
#include <LibWeb/Bindings/Intrinsics.h>
|
|
#include <LibWeb/ServiceWorker/Cache.h>
|
|
|
|
namespace Web::ServiceWorker {
|
|
|
|
GC_DEFINE_ALLOCATOR(Cache);
|
|
|
|
Cache::Cache(JS::Realm& realm, GC::Ref<RequestResponseList> request_response_list)
|
|
: Bindings::PlatformObject(realm)
|
|
, m_request_response_list(request_response_list)
|
|
{
|
|
}
|
|
|
|
void Cache::initialize(JS::Realm& realm)
|
|
{
|
|
Base::initialize(realm);
|
|
WEB_SET_PROTOTYPE_FOR_INTERFACE(Cache);
|
|
}
|
|
|
|
void Cache::visit_edges(Visitor& visitor)
|
|
{
|
|
Base::visit_edges(visitor);
|
|
visitor.visit(m_request_response_list);
|
|
}
|
|
|
|
}
|