ladybird/Libraries/LibWeb/IndexedDB/Internal/ConnectionQueueHandler.h
Andreas Kling 164ed80244 Meta: Enable exit-time destructor warnings for libraries
Enable -Wexit-time-destructors for all in-tree library targets and
update process-lifetime library statics so they no longer register
exit-time destructors. Long-lived caches, lookup tables, singleton
registries, and generated constants now use NeverDestroyed or leaked
references where the data is intended to live until process exit.

Update LibWeb, LibLine, and the binding generators so regenerated
sources follow the same rule instead of reintroducing destructed
statics.
2026-06-04 19:20:49 +02:00

43 lines
1 KiB
C++

/*
* Copyright (c) 2024, stelar7 <dudedbz@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Vector.h>
#include <LibWeb/IndexedDB/Internal/RequestList.h>
#include <LibWeb/StorageAPI/StorageKey.h>
namespace Web::IndexedDB {
// https://w3c.github.io/IndexedDB/#connection-queues
class ConnectionQueueHandler {
struct Connection;
public:
static RequestList& for_key_and_name(StorageAPI::StorageKey const& key, String const& name);
static ConnectionQueueHandler& the()
{
static ConnectionQueueHandler& instance = *new ConnectionQueueHandler;
return instance;
}
private:
Vector<NonnullRefPtr<Connection>> m_open_requests;
struct Connection final : public RefCounted<Connection> {
Connection(StorageAPI::StorageKey storage_key, String name)
: storage_key(move(storage_key))
, name(move(name))
{
}
StorageAPI::StorageKey storage_key;
String name;
RequestList request_list;
};
};
}