chromium/content/browser/locks/lock_manager.cc

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

#include "content/browser/locks/lock_manager.h"

#include <algorithm>
#include <list>
#include <memory>
#include <tuple>
#include <utility>
#include <vector>

#include "base/containers/contains.h"
#include "base/containers/flat_map.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/uuid.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/common/content_client.h"
#include "ipc/ipc_message.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "mojo/public/cpp/bindings/self_owned_associated_receiver.h"
#include "third_party/abseil-cpp/absl/utility/utility.h"

LockMode;

namespace content {

namespace {

// Guaranteed to be smaller than any result of LockManager::NextLockId().
constexpr int64_t kPreemptiveLockId =;

// A LockHandle is passed to the client when a lock is granted. As long as the
// handle is held, the lock is held. Dropping the handle - either explicitly
// by script or by process termination - causes the lock to be released. The
// connection can also be closed here when a lock is stolen.
class LockHandleImpl final : public blink::mojom::LockHandle {};

}  // namespace

// A requested or held lock. When granted, a LockHandle will be minted
// and passed to the held callback. Eventually the client will drop the
// handle, which will notify the context and remove this.
class LockManager::Lock {};

LockManager::LockManager() = default;

LockManager::~LockManager() = default;

// The BucketState class manages and exposes the state of lock requests
// for a given bucket.
class LockManager::BucketState {};

LockManager::ReceiverState::ReceiverState(std::string client_id,
                                          storage::BucketId bucket_id)
    :{}
LockManager::ReceiverState::ReceiverState() = default;
LockManager::ReceiverState::ReceiverState(const ReceiverState& other) = default;
LockManager::ReceiverState::~ReceiverState() = default;

void LockManager::BindReceiver(
    storage::BucketId bucket_id,
    mojo::PendingReceiver<blink::mojom::LockManager> receiver) {}

void LockManager::RequestLock(
    const std::string& name,
    LockMode mode,
    WaitMode wait,
    mojo::PendingAssociatedRemote<blink::mojom::LockRequest> request_remote) {}

void LockManager::ReleaseLock(storage::BucketId bucket_id, int64_t lock_id) {}

void LockManager::QueryState(QueryStateCallback callback) {}

int64_t LockManager::NextLockId() {}

}  // namespace content