#ifdef UNSAFE_BUFFERS_BUILD
#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 {
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) { … }
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) { … }
}