#include "components/offline_pages/task/sql_store_base.h"
#include <iterator>
#include <utility>
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "base/trace_event/trace_event.h"
namespace offline_pages {
namespace {
bool PrepareDirectory(const base::FilePath& path) { … }
bool InitializeSync(
sql::Database* db,
const base::FilePath& path,
const std::string& histogram_tag,
base::OnceCallback<bool(sql::Database*)> initialize_schema) { … }
void CloseDatabaseSync(
sql::Database* db,
scoped_refptr<base::SingleThreadTaskRunner> callback_runner,
base::OnceClosure callback) { … }
}
constexpr base::TimeDelta SqlStoreBase::kClosingDelay;
SqlStoreBase::SqlStoreBase(
const std::string& histogram_tag,
scoped_refptr<base::SequencedTaskRunner> background_task_runner,
const base::FilePath& file_path)
: … { … }
SqlStoreBase::~SqlStoreBase() = default;
void SqlStoreBase::SetInitializationStatusForTesting(
InitializationStatus initialization_status,
bool reset_db) { … }
void SqlStoreBase::Initialize(base::OnceClosure pending_command) { … }
void SqlStoreBase::InitializeDone(base::OnceClosure pending_command,
bool success) { … }
void SqlStoreBase::ExecuteInternal(base::OnceClosure command) { … }
sql::Database* SqlStoreBase::ExecuteBegin() { … }
void SqlStoreBase::CloseInternal() { … }
void SqlStoreBase::RescheduleClosingBefore() { … }
void SqlStoreBase::CloseInternalDone(DatabaseUniquePtr db) { … }
}