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

Unified Diff: webkit/appcache/appcache_storage.h

Issue 7031065: AppCache + Quota integration (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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
« no previous file with comments | « webkit/appcache/appcache_service_unittest.cc ('k') | webkit/appcache/appcache_storage.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/appcache/appcache_storage.h
===================================================================
--- webkit/appcache/appcache_storage.h (revision 88615)
+++ webkit/appcache/appcache_storage.h (working copy)
@@ -31,6 +31,7 @@
class AppCacheStorage {
public:
+ typedef std::map<GURL, int64> UsageMap;
class Delegate {
public:
@@ -180,10 +181,14 @@
// The working set of object instances currently in memory.
AppCacheWorkingSet* working_set() { return &working_set_; }
+ // A map of origins to usage.
+ const UsageMap* usage_map() { return &usage_map_; }
+
// Simple ptr back to the service object that owns us.
AppCacheService* service() { return service_; }
protected:
+ friend class AppCacheQuotaClientTest;
friend class AppCacheResponseTest;
friend class AppCacheStorageTest;
@@ -280,11 +285,17 @@
return ++last_response_id_;
}
+ // Helpers to query and notify the QuotaManager.
+ void UpdateUsageMapAndNotify(const GURL& origin, int64 new_usage);
+ void ClearUsageMapAndNotify();
+ void NotifyStorageAccessed(const GURL& origin);
+
// The last storage id used for different object types.
int64 last_cache_id_;
int64 last_group_id_;
int64 last_response_id_;
+ UsageMap usage_map_; // maps origin to usage
AppCacheWorkingSet working_set_;
AppCacheService* service_;
DelegateReferenceMap delegate_references_;
@@ -294,6 +305,7 @@
static const int64 kUnitializedId;
FRIEND_TEST_ALL_PREFIXES(AppCacheStorageTest, DelegateReferences);
+ FRIEND_TEST_ALL_PREFIXES(AppCacheStorageTest, UsageMap);
DISALLOW_COPY_AND_ASSIGN(AppCacheStorage);
};
« no previous file with comments | « webkit/appcache/appcache_service_unittest.cc ('k') | webkit/appcache/appcache_storage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698