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

Unified Diff: webkit/appcache/appcache_storage.cc

Issue 7031065: AppCache + Quota integration (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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: webkit/appcache/appcache_storage.cc
===================================================================
--- webkit/appcache/appcache_storage.cc (revision 87543)
+++ webkit/appcache/appcache_storage.cc (working copy)
@@ -6,6 +6,9 @@
#include "base/stl_util-inl.h"
#include "webkit/appcache/appcache_response.h"
+#include "webkit/appcache/appcache_service.h"
+#include "webkit/quota/quota_client.h"
+#include "webkit/quota/quota_manager.h"
namespace appcache {
@@ -87,5 +90,28 @@
info_load->StartIfNeeded();
}
+void AppCacheStorage::UpdateUsageMapAndNotify(
+ const GURL& origin, int64 new_usage) {
+ DCHECK_GE(new_usage, 0);
+ int64 old_usage = usage_map_[origin];
+ if (new_usage > 0)
+ usage_map_[origin] = new_usage;
+ else
+ usage_map_.erase(origin);
+ if (new_usage != old_usage && service()->quota_manager_proxy()) {
+ service()->quota_manager_proxy()->NotifyStorageModified(
+ quota::QuotaClient::kAppcache,
+ origin, quota::kStorageTypeTemporary,
+ new_usage - old_usage);
+ }
+}
+
+void AppCacheStorage::NotifyStorageAccessed(const GURL& origin) {
+ if (service()->quota_manager_proxy())
+ service()->quota_manager_proxy()->NotifyStorageAccessed(
+ quota::QuotaClient::kAppcache,
+ origin, quota::kStorageTypeTemporary);
+}
+
} // namespace appcache

Powered by Google App Engine
This is Rietveld 408576698