#include "gpu/ipc/host/gpu_disk_cache.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/not_fatal_until.h"
#include "base/threading/thread_checker.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "gpu/command_buffer/common/constants.h"
#include "gpu/config/gpu_preferences.h"
#include "net/base/cache_type.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
namespace gpu {
class GpuDiskCacheEntry { … };
class GpuDiskCacheReadHelper { … };
class GpuDiskCacheClearHelper { … };
GpuDiskCacheEntry::GpuDiskCacheEntry(GpuDiskCache* cache,
const std::string& key,
const std::string& blob)
: … { … }
GpuDiskCacheEntry::~GpuDiskCacheEntry() { … }
int GpuDiskCacheEntry::OpenEntry() { … }
void GpuDiskCacheEntry::Cache() { … }
void GpuDiskCacheEntry::OnOpComplete(int rv) { … }
void GpuDiskCacheEntry::OnEntryOpenComplete(disk_cache::EntryResult result) { … }
int GpuDiskCacheEntry::OpenCallback(int rv) { … }
int GpuDiskCacheEntry::ReopenCallback(int rv) { … }
int GpuDiskCacheEntry::WriteCallback(int rv) { … }
int GpuDiskCacheEntry::IOComplete(int rv) { … }
GpuDiskCacheReadHelper::GpuDiskCacheReadHelper(
GpuDiskCache* cache,
const BlobLoadedCallback& callback)
: … { … }
GpuDiskCacheReadHelper::~GpuDiskCacheReadHelper() { … }
void GpuDiskCacheReadHelper::LoadCache() { … }
void GpuDiskCacheReadHelper::OnOpComplete(int rv) { … }
void GpuDiskCacheReadHelper::OnEntryOpenComplete(
disk_cache::EntryResult result) { … }
int GpuDiskCacheReadHelper::OpenNextEntry() { … }
int GpuDiskCacheReadHelper::OpenNextEntryComplete(int rv) { … }
int GpuDiskCacheReadHelper::ReadComplete(int rv) { … }
int GpuDiskCacheReadHelper::IterationComplete(int rv) { … }
GpuDiskCacheClearHelper::GpuDiskCacheClearHelper(
GpuDiskCacheFactory* factory,
scoped_refptr<GpuDiskCache> cache,
base::Time delete_begin,
base::Time delete_end,
base::OnceClosure callback)
: … { … }
GpuDiskCacheClearHelper::~GpuDiskCacheClearHelper() { … }
void GpuDiskCacheClearHelper::Clear() { … }
void GpuDiskCacheClearHelper::DoClearGpuCache(int rv) { … }
GpuDiskCacheFactory::GpuDiskCacheFactory(
const HandleToPathMap& reserved_handles) { … }
GpuDiskCacheFactory::~GpuDiskCacheFactory() = default;
GpuDiskCacheHandle GpuDiskCacheFactory::GetCacheHandle(
GpuDiskCacheType type,
const base::FilePath& path) { … }
void GpuDiskCacheFactory::ReleaseCacheHandle(GpuDiskCache* cache) { … }
scoped_refptr<GpuDiskCache> GpuDiskCacheFactory::Get(
const GpuDiskCacheHandle& handle) { … }
scoped_refptr<GpuDiskCache> GpuDiskCacheFactory::Create(
const GpuDiskCacheHandle& handle,
const BlobLoadedForCacheCallback& blob_loaded_cb,
CacheDestroyedCallback cache_destroyed_cb) { … }
scoped_refptr<GpuDiskCache> GpuDiskCacheFactory::GetOrCreateByPath(
const base::FilePath& path,
const GpuDiskCache::BlobLoadedCallback& blob_loaded_cb,
base::OnceClosure cache_destroyed_cb) { … }
void GpuDiskCacheFactory::AddToCache(const base::FilePath& key,
GpuDiskCache* cache) { … }
void GpuDiskCacheFactory::RemoveFromCache(const base::FilePath& key) { … }
void GpuDiskCacheFactory::ClearByCache(scoped_refptr<GpuDiskCache> cache,
base::Time delete_begin,
base::Time delete_end,
base::OnceClosure callback) { … }
void GpuDiskCacheFactory::ClearByPath(const base::FilePath& path,
base::Time delete_begin,
base::Time delete_end,
base::OnceClosure callback) { … }
void GpuDiskCacheFactory::CacheCleared(GpuDiskCache* cache) { … }
GpuDiskCache::GpuDiskCache(GpuDiskCacheFactory* factory,
const base::FilePath& cache_path,
const BlobLoadedCallback& blob_loaded_cb,
base::OnceClosure cache_destroyed_cb)
: … { … }
GpuDiskCache::~GpuDiskCache() { … }
void GpuDiskCache::Init() { … }
void GpuDiskCache::Cache(const std::string& key, const std::string& blob) { … }
int GpuDiskCache::Clear(base::Time begin_time,
base::Time end_time,
net::CompletionOnceCallback completion_callback) { … }
int32_t GpuDiskCache::Size() { … }
int GpuDiskCache::SetAvailableCallback(net::CompletionOnceCallback callback) { … }
void GpuDiskCache::CacheCreatedCallback(disk_cache::BackendResult result) { … }
void GpuDiskCache::EntryComplete(GpuDiskCacheEntry* entry) { … }
void GpuDiskCache::ReadComplete() { … }
int GpuDiskCache::SetCacheCompleteCallback(
net::CompletionOnceCallback callback) { … }
}