#include "third_party/leveldatabase/leveldb_chrome.h"
#include <memory>
#include <set>
#include <vector>
#include "base/containers/contains.h"
#include "base/containers/flat_set.h"
#include "base/files/file.h"
#include "base/files/file_util.h"
#include "base/format_macros.h"
#include "base/functional/bind.h"
#include "base/memory/memory_pressure_listener.h"
#include "base/metrics/histogram_macros.h"
#include "base/no_destructor.h"
#include "base/strings/stringprintf.h"
#include "base/system/sys_info.h"
#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/memory_dump_provider.h"
#include "base/trace_event/process_memory_dump.h"
#include "build/build_config.h"
#include "third_party/leveldatabase/env_chromium.h"
#include "third_party/leveldatabase/src/helpers/memenv/memenv.h"
#include "util/mutexlock.h"
MemoryPressureLevel;
MemoryAllocatorDump;
MemoryDumpArgs;
MemoryDumpProvider;
ProcessMemoryDump;
Cache;
NewLRUCache;
namespace leveldb_chrome {
namespace {
size_t DefaultBlockCacheSize() { … }
std::string GetDumpNameForMemEnv(const leveldb::Env* memenv) { … }
class Globals { … };
class ChromeMemEnv : public leveldb::EnvWrapper { … };
void Globals::DumpAllTrackedEnvs(const MemoryDumpArgs& dump_args,
ProcessMemoryDump* pmd) { … }
leveldb::Status RemoveEnvDirectory(const std::string& directory,
leveldb::Env* env) { … }
class NoOpBlockCache : public Cache { … };
}
Cache* GetSharedWebBlockCache() { … }
Cache* GetSharedBrowserBlockCache() { … }
Cache* GetSharedInMemoryBlockCache() { … }
bool IsMemEnv(const leveldb::Env* env) { … }
std::unique_ptr<leveldb::Env> NewMemEnv(const std::string& name,
leveldb::Env* base_env) { … }
bool ParseFileName(const std::string& filename,
uint64_t* number,
leveldb::FileType* type) { … }
bool CorruptClosedDBForTesting(const base::FilePath& db_path) { … }
bool PossiblyValidDB(const base::FilePath& db_path, leveldb::Env* env) { … }
leveldb::Status DeleteDB(const base::FilePath& db_path,
const leveldb::Options& options) { … }
MemoryAllocatorDump* GetEnvAllocatorDump(ProcessMemoryDump* pmd,
leveldb::Env* tracked_memenv) { … }
void DumpAllTrackedEnvs(ProcessMemoryDump* pmd) { … }
}