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

Side by Side Diff: content/browser/service_worker/service_worker_cache_storage.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: Address comments from PS5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_STORAGE_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_STORAGE_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_STORAGE_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_STORAGE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 void DeleteCache(const std::string& cache_name, 78 void DeleteCache(const std::string& cache_name,
79 const BoolAndErrorCallback& callback); 79 const BoolAndErrorCallback& callback);
80 80
81 // Calls the callback with a vector of cache names (keys) available. 81 // Calls the callback with a vector of cache names (keys) available.
82 void EnumerateCaches(const StringsAndErrorCallback& callback); 82 void EnumerateCaches(const StringsAndErrorCallback& callback);
83 83
84 // TODO(jkarlin): Add match() function. 84 // TODO(jkarlin): Add match() function.
85 85
86 void CloseAllCaches(); 86 void CloseAllCaches();
87 87
88 // The size of all of the origin's contents in memory. Returns 0 if the cache
89 // backend is not a memory backend.
90 int64 MemoryBackedSize() const;
91
88 private: 92 private:
89 class MemoryLoader; 93 class MemoryLoader;
90 class SimpleCacheLoader; 94 class SimpleCacheLoader;
91 class CacheLoader; 95 class CacheLoader;
92 96
93 typedef std::map<std::string, base::WeakPtr<ServiceWorkerCache> > CacheMap; 97 typedef std::map<std::string, base::WeakPtr<ServiceWorkerCache> > CacheMap;
94 98
95 // Return a ServiceWorkerCache for the given name if the name is known. If the 99 // Return a ServiceWorkerCache for the given name if the name is known. If the
96 // ServiceWorkerCache has been deleted, creates a new one. 100 // ServiceWorkerCache has been deleted, creates a new one.
97 scoped_refptr<ServiceWorkerCache> GetLoadedCache( 101 scoped_refptr<ServiceWorkerCache> GetLoadedCache(
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 scoped_ptr<CacheLoader> cache_loader_; 152 scoped_ptr<CacheLoader> cache_loader_;
149 153
150 base::WeakPtrFactory<ServiceWorkerCacheStorage> weak_factory_; 154 base::WeakPtrFactory<ServiceWorkerCacheStorage> weak_factory_;
151 155
152 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerCacheStorage); 156 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerCacheStorage);
153 }; 157 };
154 158
155 } // namespace content 159 } // namespace content
156 160
157 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_STORAGE_H_ 161 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_STORAGE_H_
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_cache.cc ('k') | content/browser/service_worker/service_worker_cache_storage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698