mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 16:16:43 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
48
Libraries/LibWeb/IndexedDB/Internal/ConnectionQueueHandler.h
Normal file
48
Libraries/LibWeb/IndexedDB/Internal/ConnectionQueueHandler.h
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2024, stelar7 <dudedbz@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/HashMap.h>
|
||||
#include <LibJS/Heap/Handle.h>
|
||||
#include <LibWeb/DOM/EventTarget.h>
|
||||
#include <LibWeb/IndexedDB/IDBRequest.h>
|
||||
#include <LibWeb/StorageAPI/StorageKey.h>
|
||||
|
||||
namespace Web::IndexedDB {
|
||||
|
||||
class ConnectionQueue : public AK::Vector<JS::Handle<IDBRequest>> {
|
||||
public:
|
||||
bool all_previous_requests_processed(JS::NonnullGCPtr<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>>;
|
||||
|
||||
// https://w3c.github.io/IndexedDB/#connection-queues
|
||||
class ConnectionQueueHandler {
|
||||
public:
|
||||
static ConnectionQueue& for_key_and_name(StorageAPI::StorageKey& key, String& name);
|
||||
static ConnectionQueueHandler& the()
|
||||
{
|
||||
static ConnectionQueueHandler s_instance;
|
||||
return s_instance;
|
||||
}
|
||||
|
||||
private:
|
||||
ConnectionMap m_open_requests;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue