ladybird/Libraries/LibWeb/ServiceWorker/CacheStorage.cpp
Timothy Flynn 70db474cf0 LibJS+LibWeb: Port interned bytecode strings to UTF-16
This was almost a no-op, except we intern JS exception messages. So the
bulk of this patch is porting exception messages to UTF-16.
2025-08-14 10:27:08 +02:00

40 lines
1.1 KiB
C++

/*
* Copyright (c) 2025, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/Bindings/CacheStoragePrototype.h>
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/ServiceWorker/CacheStorage.h>
#include <LibWeb/WebIDL/Promise.h>
namespace Web::ServiceWorker {
GC_DEFINE_ALLOCATOR(CacheStorage);
CacheStorage::CacheStorage(JS::Realm& realm)
: Bindings::PlatformObject(realm)
{
}
void CacheStorage::initialize(JS::Realm& realm)
{
Base::initialize(realm);
WEB_SET_PROTOTYPE_FOR_INTERFACE(CacheStorage);
}
// https://w3c.github.io/ServiceWorker/#cache-storage-open
GC::Ref<WebIDL::Promise> CacheStorage::open(String const&)
{
return WebIDL::create_rejected_promise(realm(), WebIDL::NotSupportedError::create(realm(), "CacheStorage.open() is not yet implemented"_utf16));
}
// https://w3c.github.io/ServiceWorker/#cache-storage-has
GC::Ref<WebIDL::Promise> CacheStorage::has(String const&)
{
dbgln("FIXME: CacheStorage::has() is not implemented yet");
return WebIDL::create_rejected_promise(realm(), JS::Value(false));
}
}