#include "components/services/storage/indexed_db/leveldb/fake_leveldb_factory.h"
#include <mutex>
#include <optional>
#include <string>
#include <thread>
#include <utility>
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/synchronization/lock.h"
#include "base/thread_annotations.h"
#include "components/services/storage/indexed_db/leveldb/leveldb_state.h"
#include "third_party/leveldatabase/src/include/leveldb/db.h"
#include "third_party/leveldatabase/src/include/leveldb/slice.h"
#include "third_party/leveldatabase/src/include/leveldb/status.h"
namespace content {
namespace {
class FlakyIterator;
class FlakyDB : public leveldb::DB { … };
class FlakyIterator : public leveldb::Iterator { … };
leveldb::Iterator* FlakyDB::NewIterator(const leveldb::ReadOptions& options) { … }
class BrokenIterator : public leveldb::Iterator { … };
class BrokenDB : public leveldb::DB { … };
class BreakOnCallbackDB : public leveldb::DB { … };
}
std::unique_ptr<leveldb::DB> FakeLevelDBFactory::CreateFlakyDB(
std::unique_ptr<leveldb::DB> db,
std::queue<FlakePoint> flake_points) { … }
std::pair<std::unique_ptr<leveldb::DB>,
base::OnceCallback<void(leveldb::Status)>>
FakeLevelDBFactory::CreateBreakableDB(std::unique_ptr<leveldb::DB> db) { … }
scoped_refptr<LevelDBState> FakeLevelDBFactory::GetBrokenLevelDB(
leveldb::Status error_to_return,
const base::FilePath& reported_file_path) { … }
}