chromium/components/segmentation_platform/internal/database/ukm_database_backend.cc

// 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.

#include "components/segmentation_platform/internal/database/ukm_database_backend.h"

#include "base/check_is_test.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/rand_util.h"
#include "base/strings/stringprintf.h"
#include "base/task/sequenced_task_runner.h"
#include "components/segmentation_platform/internal/database/ukm_metrics_table.h"
#include "components/segmentation_platform/internal/database/ukm_types.h"
#include "components/segmentation_platform/internal/database/ukm_url_table.h"
#include "components/segmentation_platform/internal/database/uma_metrics_table.h"
#include "sql/database.h"
#include "sql/statement.h"
#include "sql/transaction.h"

namespace segmentation_platform {

namespace {

BASE_FEATURE();

// Up to 10 updates are batched, because ~10 UKM metrics recorded in db per
// page load and approximately a commit every page load. This might need update
// if the metric count increases in the future.
static constexpr int kChangeCountToCommit =;

bool SanityCheckUrl(const GURL& url, UrlId url_id) {}

std::string BindValuesToStatement(
    const std::vector<processing::ProcessedValue>& bind_values,
    sql::Statement& statement) {}

float GetSingleFloatOutput(sql::Statement& statement) {}

void ErrorCallback(int code, sql::Statement* stmt) {}

}  // namespace

UkmDatabaseBackend::UkmDatabaseBackend(
    const base::FilePath& database_path,
    bool in_memory,
    scoped_refptr<base::SequencedTaskRunner> callback_task_runner)
    :{}

UkmDatabaseBackend::~UkmDatabaseBackend() {}

void UkmDatabaseBackend::InitDatabase(SuccessCallback callback) {}

void UkmDatabaseBackend::StoreUkmEntry(ukm::mojom::UkmEntryPtr entry) {}

void UkmDatabaseBackend::UpdateUrlForUkmSource(ukm::SourceId source_id,
                                               const GURL& url,
                                               bool is_validated,
                                               const std::string& profile_id) {}

void UkmDatabaseBackend::OnUrlValidated(const GURL& url,
                                        const std::string& profile_id) {}

void UkmDatabaseBackend::RemoveUrls(const std::vector<GURL>& urls,
                                    bool all_urls) {}

void UkmDatabaseBackend::AddUmaMetric(const std::string& profile_id,
                                      const UmaMetricEntry& row) {}

void UkmDatabaseBackend::RunReadOnlyQueries(QueryList&& queries,
                                            QueryCallback callback) {}

void UkmDatabaseBackend::DeleteEntriesOlderThan(base::Time time) {}

void UkmDatabaseBackend::CommitTransactionForTesting() {}

void UkmDatabaseBackend::RollbackTransactionForTesting() {}

void UkmDatabaseBackend::DeleteAllUrls() {}

void UkmDatabaseBackend::TrackChangesInTransaction(int change_count) {}

void UkmDatabaseBackend::RestartTransaction() {}

}  // namespace segmentation_platform