chromium/third_party/blink/renderer/modules/ad_auction/join_leave_queue.h

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_AD_AUCTION_JOIN_LEAVE_QUEUE_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_AD_AUCTION_JOIN_LEAVE_QUEUE_H_

#include "base/check.h"
#include "base/check_op.h"
#include "base/functional/callback.h"
#include "third_party/blink/renderer/platform/wtf/deque.h"

namespace blink {

// A FIFO queue for interest group joins and leaves. It ensures there are never
// more than `max_active` started requests, adding requests to a queue if they
// can't be immediately started. Once the consumer informs it when a previously
// start request completes, it will start another request, if one is queued.
//
// This is a separate class so it can be unit tested.
template <typename T>
class JoinLeaveQueue {};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_MODULES_AD_AUCTION_JOIN_LEAVE_QUEUE_H_