#include "services/network/trust_tokens/trust_token_database_owner.h"
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "base/memory/ptr_util.h"
#include "base/memory/scoped_refptr.h"
#include "base/sequence_checker.h"
#include "base/task/sequenced_task_runner.h"
#include "components/sqlite_proto/key_value_data.h"
#include "components/sqlite_proto/key_value_table.h"
#include "components/sqlite_proto/proto_table_manager.h"
#include "services/network/trust_tokens/proto/storage.pb.h"
#include "sql/database.h"
namespace network {
namespace {
const char kIssuerTableName[] = …;
const char kToplevelTableName[] = …;
const char kIssuerToplevelPairTableName[] = …;
constexpr int kCurrentSchemaVersion = …;
}
void TrustTokenDatabaseOwner::Create(
base::OnceCallback<bool(sql::Database*)> db_opener,
scoped_refptr<base::SequencedTaskRunner> db_task_runner,
base::TimeDelta flush_delay_for_writes,
base::OnceCallback<void(std::unique_ptr<TrustTokenDatabaseOwner>)>
on_done_initializing) { … }
TrustTokenDatabaseOwner::~TrustTokenDatabaseOwner() { … }
sqlite_proto::KeyValueData<TrustTokenIssuerConfig>*
TrustTokenDatabaseOwner::IssuerData() { … }
sqlite_proto::KeyValueData<TrustTokenToplevelConfig>*
TrustTokenDatabaseOwner::ToplevelData() { … }
sqlite_proto::KeyValueData<TrustTokenIssuerToplevelPairConfig>*
TrustTokenDatabaseOwner::IssuerToplevelPairData() { … }
NOINLINE TrustTokenDatabaseOwner::TrustTokenDatabaseOwner(
base::OnceCallback<bool(sql::Database*)> db_opener,
scoped_refptr<base::SequencedTaskRunner> db_task_runner,
base::TimeDelta flush_delay_for_writes,
base::OnceCallback<void(std::unique_ptr<TrustTokenDatabaseOwner>)>
on_done_initializing)
: … { … }
void TrustTokenDatabaseOwner::InitializeMembersOnDbSequence(
base::OnceCallback<bool(sql::Database*)> db_opener) { … }
void TrustTokenDatabaseOwner::FinishInitializationOnMainSequence() { … }
}