| Index: webkit/appcache/appcache_storage.cc
|
| ===================================================================
|
| --- webkit/appcache/appcache_storage.cc (revision 88004)
|
| +++ 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
|
|
|
|
|