| Index: webkit/appcache/appcache_database.cc
|
| ===================================================================
|
| --- webkit/appcache/appcache_database.cc (revision 88004)
|
| +++ webkit/appcache/appcache_database.cc (working copy)
|
| @@ -182,6 +182,15 @@
|
| ResetConnectionAndTables();
|
| }
|
|
|
| +// TODO(michaeln): remove me
|
| +int64 AppCacheDatabase::GetOriginQuota(const GURL& origin) {
|
| + if (!LazyOpen(false))
|
| + return GetDefaultOriginQuota();
|
| + int64 quota = quota_table_->GetOriginQuota(
|
| + UTF8ToUTF16(origin.spec().c_str()));
|
| + return (quota >= 0) ? quota : GetDefaultOriginQuota();
|
| +}
|
| +
|
| int64 AppCacheDatabase::GetOriginUsage(const GURL& origin) {
|
| std::vector<CacheRecord> records;
|
| if (!FindCachesForOrigin(origin, &records))
|
| @@ -196,12 +205,15 @@
|
| return origin_usage;
|
| }
|
|
|
| -int64 AppCacheDatabase::GetOriginQuota(const GURL& origin) {
|
| - if (!LazyOpen(false))
|
| - return GetDefaultOriginQuota();
|
| - int64 quota = quota_table_->GetOriginQuota(
|
| - UTF8ToUTF16(origin.spec().c_str()));
|
| - return (quota >= 0) ? quota : GetDefaultOriginQuota();
|
| +bool AppCacheDatabase::GetAllOriginUsage(std::map<GURL, int64>* usage_map) {
|
| + std::set<GURL> origins;
|
| + if (!FindOriginsWithGroups(&origins))
|
| + return false;
|
| + for (std::set<GURL>::const_iterator origin = origins.begin();
|
| + origin != origins.end(); ++origin) {
|
| + (*usage_map)[*origin] = GetOriginUsage(*origin);
|
| + }
|
| + return true;
|
| }
|
|
|
| bool AppCacheDatabase::FindOriginsWithGroups(std::set<GURL>* origins) {
|
|
|