#include "components/services/storage/indexed_db/scopes/leveldb_scopes.h"
#include <memory>
#include <string>
#include <utility>
#include "base/compiler_specific.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/ptr_util.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "components/services/storage/indexed_db/leveldb/leveldb_state.h"
#include "components/services/storage/indexed_db/locks/partitioned_lock_manager.h"
#include "components/services/storage/indexed_db/scopes/leveldb_scope.h"
#include "components/services/storage/indexed_db/scopes/leveldb_scopes_coding.h"
#include "components/services/storage/indexed_db/scopes/leveldb_scopes_tasks.h"
#include "components/services/storage/indexed_db/scopes/scopes_metadata.pb.h"
#include "third_party/leveldatabase/src/include/leveldb/db.h"
#include "third_party/leveldatabase/src/include/leveldb/iterator.h"
#include "third_party/leveldatabase/src/include/leveldb/slice.h"
namespace content {
static constexpr base::TaskTraits kCleanupTaskTraits = …;
LevelDBScopes::LevelDBScopes(std::vector<uint8_t> metadata_key_prefix,
size_t max_write_batch_size_bytes,
scoped_refptr<LevelDBState> level_db,
PartitionedLockManager* lock_manager,
TearDownCallback tear_down_callback)
: … { … }
LevelDBScopes::~LevelDBScopes() = default;
leveldb::Status LevelDBScopes::Initialize() { … }
void LevelDBScopes::StartRecoveryAndCleanupTasks() { … }
std::unique_ptr<LevelDBScope> LevelDBScopes::CreateScope(
std::vector<PartitionedLock> locks) { … }
leveldb::Status LevelDBScopes::Commit(std::unique_ptr<LevelDBScope> scope,
bool sync_on_commit,
base::OnceClosure on_commit_complete,
base::OnceClosure on_cleanup_complete) { … }
void LevelDBScopes::Rollback(int64_t scope_id,
std::vector<PartitionedLock> locks) { … }
void LevelDBScopes::OnCleanupTaskResult(base::OnceClosure on_complete,
leveldb::Status result) { … }
}