chromium/components/data_sharing/internal/group_data_store.cc

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

#include "components/data_sharing/internal/group_data_store.h"

#include <optional>
#include <string>
#include <vector>

#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/functional/callback_forward.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/memory/scoped_refptr.h"
#include "base/task/bind_post_task.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "base/time/time.h"
#include "components/data_sharing/internal/group_data_proto_utils.h"
#include "components/data_sharing/internal/protocol/group_data_db.pb.h"
#include "components/data_sharing/public/group_data.h"
#include "components/sqlite_proto/proto_table_manager.h"
#include "sql/database.h"

namespace data_sharing {

namespace {

constexpr base::TaskTraits kDBTaskTraits =;

constexpr char kGroupEntitiesTableName[] =;
constexpr int kCurrentSchemaVersion =;
// TODO(crbug.com/301390275): make this consistent with other places where
// amount of groups are limited once numbers are known.
constexpr size_t kMaxNumEntriesInDB =;

GroupDataStore::DBInitStatus InitOnDBSequence(
    base::FilePath db_path,
    sql::Database* db,
    sqlite_proto::ProtoTableManager* table_manager,
    sqlite_proto::KeyValueData<data_sharing_pb::GroupEntity>*
        group_entity_data) {}

}  // namespace

GroupDataStore::GroupDataStore(const base::FilePath& db_path,
                               DBLoadedCallback db_loaded_callback)
    :{}

GroupDataStore::~GroupDataStore() {}

void GroupDataStore::StoreGroupData(const VersionToken& version_token,
                                    const GroupData& group_data) {}

void GroupDataStore::DeleteGroups(const std::vector<GroupId>& groups_ids) {}

std::optional<VersionToken> GroupDataStore::GetGroupVersionToken(
    const GroupId& group_id) const {}

std::optional<GroupData> GroupDataStore::GetGroupData(
    const GroupId& group_id) const {}

std::vector<GroupId> GroupDataStore::GetAllGroupIds() const {}

void GroupDataStore::OnDBReady(DBLoadedCallback db_loaded_callback,
                               DBInitStatus status) {}

}  // namespace data_sharing