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

Unified Diff: chrome/browser/browsing_data/browsing_data_quota_helper_impl.cc

Issue 13357004: Clear browsing data clears data for type kStorageTypeTemporary but not for kStorageTypeSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase again Created 7 years, 8 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: chrome/browser/browsing_data/browsing_data_quota_helper_impl.cc
diff --git a/chrome/browser/browsing_data/browsing_data_quota_helper_impl.cc b/chrome/browser/browsing_data/browsing_data_quota_helper_impl.cc
index fd63afecb386cd1b43b187360d957d135a53f8a8..1c163d7a7dd42d25e9a81776ff13c4af17ffd28a 100644
--- a/chrome/browser/browsing_data/browsing_data_quota_helper_impl.cc
+++ b/chrome/browser/browsing_data/browsing_data_quota_helper_impl.cc
@@ -93,16 +93,24 @@ void BrowsingDataQuotaHelperImpl::GotOrigins(
pending_hosts_.insert(std::make_pair(itr->host(), type));
DCHECK(type == quota::kStorageTypeTemporary ||
- type == quota::kStorageTypePersistent);
+ type == quota::kStorageTypePersistent ||
+ type == quota::kStorageTypeSyncable);
+ // Calling GetOriginsModifiedSince() for all types by chaining callbacks.
if (type == quota::kStorageTypeTemporary) {
quota_manager_->GetOriginsModifiedSince(
quota::kStorageTypePersistent,
base::Time(),
base::Bind(&BrowsingDataQuotaHelperImpl::GotOrigins,
weak_factory_.GetWeakPtr()));
+ } else if (type == quota::kStorageTypePersistent) {
+ quota_manager_->GetOriginsModifiedSince(
+ quota::kStorageTypeSyncable,
+ base::Time(),
+ base::Bind(&BrowsingDataQuotaHelperImpl::GotOrigins,
+ weak_factory_.GetWeakPtr()));
} else {
- // type == quota::kStorageTypePersistent
+ DCHECK(type == quota::kStorageTypeSyncable);
ProcessPendingHosts();
}
}
@@ -139,6 +147,9 @@ void BrowsingDataQuotaHelperImpl::GotHostUsage(const std::string& host,
case quota::kStorageTypePersistent:
quota_info_[host].persistent_usage = usage;
break;
+ case quota::kStorageTypeSyncable:
+ quota_info_[host].syncable_usage = usage;
+ break;
default:
NOTREACHED();
}
@@ -163,7 +174,8 @@ void BrowsingDataQuotaHelperImpl::OnComplete() {
QuotaInfo* info = &itr->second;
// Skip unused entries
if (info->temporary_usage <= 0 &&
- info->persistent_usage <= 0)
+ info->persistent_usage <= 0 &&
+ info->syncable_usage <= 0)
continue;
info->host = itr->first;

Powered by Google App Engine
This is Rietveld 408576698