chromium/chrome/browser/extensions/activity_log/activity_database.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "chrome/browser/extensions/activity_log/activity_database.h"

#include <string>

#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/time/clock.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/activity_log/activity_log_task_runner.h"
#include "chrome/browser/extensions/activity_log/fullstream_ui_policy.h"
#include "chrome/common/chrome_switches.h"
#include "sql/error_delegate_util.h"
#include "sql/init_status.h"
#include "sql/sqlite_result_code_values.h"
#include "sql/transaction.h"

#if BUILDFLAG(IS_MAC)
#include "base/apple/backup_util.h"
#endif

namespace extensions {

// A size threshold at which data should be flushed to the database.  The
// ActivityDatabase will signal the Delegate to write out data based on a
// periodic timer, but will also initiate a flush if AdviseFlush indicates that
// more than kSizeThresholdForFlush action records are queued in memory.  This
// should be set large enough that write costs can be amortized across many
// records, but not so large that too much space can be tied up holding records
// in memory.
static const int kSizeThresholdForFlush =;

ActivityDatabase::ActivityDatabase(ActivityDatabase::Delegate* delegate)
    :{}

ActivityDatabase::~ActivityDatabase() {}

void ActivityDatabase::Init(const base::FilePath& db_name) {}

void ActivityDatabase::LogInitFailure() {}

void ActivityDatabase::AdviseFlush(int size) {}

void ActivityDatabase::RecordBatchedActions() {}

void ActivityDatabase::SetBatchModeForTesting(bool batch_mode) {}

sql::Database* ActivityDatabase::GetSqlConnection() {}

void ActivityDatabase::Close() {}

void ActivityDatabase::HardFailureClose() {}

void ActivityDatabase::SoftFailureClose() {}

void ActivityDatabase::DatabaseErrorCallback(int error, sql::Statement* stmt) {}

void ActivityDatabase::RecordBatchedActionsWhileTesting() {}

void ActivityDatabase::SetTimerForTesting(int ms) {}

// static
bool ActivityDatabase::InitializeTable(sql::Database* db,
                                       base::cstring_view table_name,
                                       const char* const content_fields[],
                                       const char* const field_types[],
                                       const int num_content_fields) {}

}  // namespace extensions