Chromium Code Reviews| Index: chrome/browser/browsing_data_remover.cc |
| diff --git a/chrome/browser/browsing_data_remover.cc b/chrome/browser/browsing_data_remover.cc |
| index b759d1deb2a86a63dda7abd75b33adf052635492..15a04fd8b1fe5bc87b3e98b94e62e4854fbad0f3 100644 |
| --- a/chrome/browser/browsing_data_remover.cc |
| +++ b/chrome/browser/browsing_data_remover.cc |
| @@ -50,6 +50,25 @@ |
| #include "net/url_request/url_request_context_getter.h" |
| #include "webkit/quota/quota_manager.h" |
| #include "webkit/quota/quota_types.h" |
| +#include "webkit/quota/quota_client.h" |
| + |
| +namespace { |
| + |
| +int generateQuotaClientMask(int remove_mask) { |
|
Mike West
2011/09/07 14:43:19
I don't really think this needs to exist anywhere
jochen (gone - plz use gerrit)
2011/09/12 11:23:00
tests :)
kinuko
2011/09/26 09:43:48
The first letter should be capital?
|
| + int quota_client_mask = quota::QuotaClient::kUnknown; |
| + if (remove_mask & BrowsingDataRemover::REMOVE_FILE_SYSTEMS) |
| + quota_client_mask |= quota::QuotaClient::kFileSystem; |
| + if (remove_mask & BrowsingDataRemover::REMOVE_WEBSQL) |
| + quota_client_mask |= quota::QuotaClient::kDatabase; |
| + if (remove_mask & BrowsingDataRemover::REMOVE_APPCACHE) |
| + quota_client_mask |= quota::QuotaClient::kAppcache; |
| + if (remove_mask & BrowsingDataRemover::REMOVE_INDEXEDDB) |
| + quota_client_mask |= quota::QuotaClient::kIndexedDatabase; |
| + |
| + return quota_client_mask; |
| +} |
| + |
| +} |
| // Done so that we can use PostTask on BrowsingDataRemovers and not have |
| // BrowsingDataRemover implement RefCounted. |
| @@ -221,6 +240,7 @@ void BrowsingDataRemover::Remove(int remove_mask) { |
| // QuotaManager. Until then, we'll clear all quota-managed data types if any |
| // ought to be cleared. |
| quota_manager_ = profile_->GetQuotaManager(); |
| + quota_client_mask_ = generateQuotaClientMask(remove_mask); |
| if (quota_manager_) { |
| waiting_for_clear_quota_managed_data_ = true; |
| BrowserThread::PostTask( |
| @@ -511,8 +531,8 @@ void BrowsingDataRemover::OnGotQuotaManagedOrigins( |
| continue; |
| ++quota_managed_origins_to_delete_count_; |
| quota_manager_->DeleteOriginData(origin->GetOrigin(), |
| - type, NewCallback(this, |
| - &BrowsingDataRemover::OnQuotaManagedOriginDeletion)); |
| + type, quota_client_mask_, |
| + NewCallback(this, &BrowsingDataRemover::OnQuotaManagedOriginDeletion)); |
| } |
| --quota_managed_storage_types_to_delete_count_; |