// means that all unused cache items will be removed on Shutdown.
// All file I/O is done via the |backend_task_runner|.
LocalExtensionCache(const base::FilePath& cache_dir,
- size_t max_cache_size,
+ uint64 max_cache_size,
const base::TimeDelta& max_cache_age,
const scoped_refptr<base::SequencedTaskRunner>&
backend_task_runner);
// removed from disk too.
bool RemoveExtension(const std::string& id);
+ // Return cache statistics. Returns |false| if cache is not ready.
+ bool GetStatistics(uint64* cache_size,
+ size_t* extensions_count);
+
bool is_ready() const { return state_ == kReady; }
bool is_uninitialized() const { return state_ == kUninitialized; }
bool is_shutdown() const { return state_ == kShutdown; }
struct CacheItemInfo {
std::string version;
base::Time last_used;
- int64 size;
+ uint64 size;
base::FilePath file_path;
CacheItemInfo(const std::string& version,
const base::Time& last_used,
- const size_t size,
+ uint64 size,
const base::FilePath& file_path);
};
typedef std::map<std::string, CacheItemInfo> CacheMap;
base::FilePath cache_dir_;
// Maximum size of cache dir on disk.
- size_t max_cache_size_;
+ uint64 max_cache_size_;
// Minimal age of unused item in cache, items prior to this age will be
// deleted on shutdown.