mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibWeb: Rename ConnectionQueue to RequestList
This commit is contained in:
parent
439245b14a
commit
b43bb2429a
Notes:
github-actions[bot]
2025-01-14 22:47:13 +00:00
Author: https://github.com/stelar7
Commit: b43bb2429a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3190
Reviewed-by: https://github.com/Lubrsi
Reviewed-by: https://github.com/gmta ✅
6 changed files with 67 additions and 28 deletions
|
@ -7,34 +7,17 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/HashMap.h>
|
||||
#include <LibGC/Root.h>
|
||||
#include <LibWeb/DOM/EventTarget.h>
|
||||
#include <LibWeb/IndexedDB/IDBRequest.h>
|
||||
#include <LibWeb/IndexedDB/Internal/RequestList.h>
|
||||
#include <LibWeb/StorageAPI/StorageKey.h>
|
||||
|
||||
namespace Web::IndexedDB {
|
||||
|
||||
class ConnectionQueue : public AK::Vector<GC::Root<IDBRequest>> {
|
||||
public:
|
||||
bool all_previous_requests_processed(GC::Ref<IDBRequest> const& request) const
|
||||
{
|
||||
for (auto const& entry : *this) {
|
||||
if (entry == request)
|
||||
return true;
|
||||
if (!entry->processed())
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
using ConnectionMap = HashMap<StorageAPI::StorageKey, HashMap<String, ConnectionQueue>>;
|
||||
using ConnectionMap = HashMap<StorageAPI::StorageKey, HashMap<String, RequestList>>;
|
||||
|
||||
// https://w3c.github.io/IndexedDB/#connection-queues
|
||||
class ConnectionQueueHandler {
|
||||
public:
|
||||
static ConnectionQueue& for_key_and_name(StorageAPI::StorageKey& key, String& name);
|
||||
static RequestList& for_key_and_name(StorageAPI::StorageKey& key, String& name);
|
||||
static ConnectionQueueHandler& the()
|
||||
{
|
||||
static ConnectionQueueHandler s_instance;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue