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

Unified Diff: content/browser/service_worker/service_worker_cache.h

Issue 672943002: [ServiceWorkerCache] Return the real size of the cache in GetOriginUsage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@quota_modified
Patch Set: Rebase Created 6 years, 2 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: content/browser/service_worker/service_worker_cache.h
diff --git a/content/browser/service_worker/service_worker_cache.h b/content/browser/service_worker/service_worker_cache.h
index 65966090ed52ff3ea04054494ed698d72d2961cc..ae9b7f3d7fe6381af0f8d8b64fb150b9f84996b8 100644
--- a/content/browser/service_worker/service_worker_cache.h
+++ b/content/browser/service_worker/service_worker_cache.h
@@ -90,6 +90,10 @@ class CONTENT_EXPORT ServiceWorkerCache
// Prevent further operations on this object and delete the backend.
void Close();
+ // The size of the cache contents in memory. Returns 0 if the cache backend is
+ // not a memory cache backend.
+ int64 MemoryBackedSize() const;
+
void set_backend(scoped_ptr<disk_cache::Backend> backend) {
backend_ = backend.Pass();
}
@@ -146,6 +150,9 @@ class CONTENT_EXPORT ServiceWorkerCache
bool initialized_;
std::vector<base::Closure> init_callbacks_;
+ // Whether or not to store data in disk or memory.
+ bool memory_only_;
+
base::WeakPtrFactory<ServiceWorkerCache> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerCache);

Powered by Google App Engine
This is Rietveld 408576698