Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Unified Diff: chrome/browser/extensions/updater/local_extension_cache.h

Issue 148013004: Add UMA stats for ExtensionCache (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compilation Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/updater/local_extension_cache.h
diff --git a/chrome/browser/extensions/updater/local_extension_cache.h b/chrome/browser/extensions/updater/local_extension_cache.h
index 604b6707fbe75e5e8368120e1dbcb87f827f97af..63652bab55a371e57e95a3d416e689c47289879e 100644
--- a/chrome/browser/extensions/updater/local_extension_cache.h
+++ b/chrome/browser/extensions/updater/local_extension_cache.h
@@ -32,7 +32,7 @@ class LocalExtensionCache {
// 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);
@@ -73,6 +73,10 @@ class LocalExtensionCache {
// 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; }
@@ -84,12 +88,12 @@ class LocalExtensionCache {
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;
@@ -175,7 +179,7 @@ class LocalExtensionCache {
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.
« no previous file with comments | « chrome/browser/extensions/updater/extension_cache_impl.cc ('k') | chrome/browser/extensions/updater/local_extension_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698