chromium/components/leveldb_proto/internal/shared_proto_database_client.h

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

#ifndef COMPONENTS_LEVELDB_PROTO_INTERNAL_SHARED_PROTO_DATABASE_CLIENT_H_
#define COMPONENTS_LEVELDB_PROTO_INTERNAL_SHARED_PROTO_DATABASE_CLIENT_H_

#include <memory>
#include <optional>
#include <string>

#include "base/component_export.h"
#include "base/functional/bind.h"
#include "base/sequence_checker.h"
#include "base/types/strong_alias.h"
#include "components/leveldb_proto/internal/leveldb_database.h"
#include "components/leveldb_proto/internal/proto/shared_db_metadata.pb.h"
#include "components/leveldb_proto/internal/unique_proto_database.h"
#include "components/leveldb_proto/public/shared_proto_database_client_list.h"

namespace leveldb_proto {

// Key prefix not visible to the client.
KeyPrefix;
// Logical key visible to the client.
LogicalKey;
// Physical key used in the underlying db.
PhysicalKey;

class SharedProtoDatabase;

// TODO: Move all these as static or member functions in the class.
ClientCorruptCallback;
SharedClientInitCallback;

// An implementation of ProtoDatabase<T> that uses a shared LevelDB and task
// runner.
// Should be created, destroyed, and used on the same sequenced task runner.
class COMPONENT_EXPORT(LEVELDB_PROTO) SharedProtoDatabaseClient
    : public UniqueProtoDatabase {};

}  // namespace leveldb_proto

#endif  // COMPONENTS_LEVELDB_PROTO_INTERNAL_SHARED_PROTO_DATABASE_CLIENT_H_