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 70083fec65abd80c63ab05dcb2768e0dac006baf..01b0ce36e2fabd1b9dcc53f03e3976b1df23a29d 100644 |
| --- a/chrome/browser/browsing_data_remover.cc |
| +++ b/chrome/browser/browsing_data_remover.cc |
| @@ -67,11 +67,8 @@ BrowsingDataRemover::BrowsingDataRemover(Profile* profile, |
| this, &BrowsingDataRemover::OnClearedDatabases)), |
| ALLOW_THIS_IN_INITIALIZER_LIST(cache_callback_( |
| this, &BrowsingDataRemover::DoClearCache)), |
| - ALLOW_THIS_IN_INITIALIZER_LIST(appcache_got_info_callback_( |
| - this, &BrowsingDataRemover::OnGotAppCacheInfo)), |
| - ALLOW_THIS_IN_INITIALIZER_LIST(appcache_deleted_callback_( |
| - this, &BrowsingDataRemover::OnAppCacheDeleted)), |
| - appcaches_to_be_deleted_count_(0), |
| + ALLOW_THIS_IN_INITIALIZER_LIST(appcache_cleared_callback_( |
| + this, &BrowsingDataRemover::OnClearedAppCache)), |
| next_cache_state_(STATE_NONE), |
| cache_(NULL), |
| main_context_getter_(profile->GetRequestContext()), |
| @@ -97,11 +94,8 @@ BrowsingDataRemover::BrowsingDataRemover(Profile* profile, |
| this, &BrowsingDataRemover::OnClearedDatabases)), |
| ALLOW_THIS_IN_INITIALIZER_LIST(cache_callback_( |
| this, &BrowsingDataRemover::DoClearCache)), |
| - ALLOW_THIS_IN_INITIALIZER_LIST(appcache_got_info_callback_( |
| - this, &BrowsingDataRemover::OnGotAppCacheInfo)), |
| - ALLOW_THIS_IN_INITIALIZER_LIST(appcache_deleted_callback_( |
| - this, &BrowsingDataRemover::OnAppCacheDeleted)), |
| - appcaches_to_be_deleted_count_(0), |
| + ALLOW_THIS_IN_INITIALIZER_LIST(appcache_cleared_callback_( |
| + this, &BrowsingDataRemover::OnClearedAppCache)), |
| next_cache_state_(STATE_NONE), |
| cache_(NULL), |
| main_context_getter_(profile->GetRequestContext()), |
| @@ -514,11 +508,11 @@ void BrowsingDataRemover::ClearDatabasesOnFILEThread() { |
| OnClearedDatabases(rv); |
| } |
| -void BrowsingDataRemover::OnClearedAppCache() { |
| +void BrowsingDataRemover::OnClearedAppCache(int rv) { |
| if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
| bool result = BrowserThread::PostTask( |
| BrowserThread::UI, FROM_HERE, |
| - NewRunnableMethod(this, &BrowsingDataRemover::OnClearedAppCache)); |
| + NewRunnableMethod(this, &BrowsingDataRemover::OnClearedAppCache, rv)); |
| DCHECK(result); |
| return; |
| } |
| @@ -529,40 +523,8 @@ void BrowsingDataRemover::OnClearedAppCache() { |
| void BrowsingDataRemover::ClearAppCacheOnIOThread() { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| DCHECK(waiting_for_clear_appcache_); |
| - appcache_info_ = new appcache::AppCacheInfoCollection; |
| - appcache_service_->GetAllAppCacheInfo( |
| - appcache_info_, &appcache_got_info_callback_); |
| - // continues in OnGotAppCacheInfo. |
| -} |
| - |
| -void BrowsingDataRemover::OnGotAppCacheInfo(int rv) { |
| - using appcache::AppCacheInfoVector; |
| - typedef std::map<GURL, AppCacheInfoVector> InfoByOrigin; |
| - |
| - for (InfoByOrigin::const_iterator origin = |
| - appcache_info_->infos_by_origin.begin(); |
| - origin != appcache_info_->infos_by_origin.end(); ++origin) { |
| - if (special_storage_policy_->IsStorageProtected(origin->first)) |
| - continue; |
| - for (AppCacheInfoVector::const_iterator info = origin->second.begin(); |
| - info != origin->second.end(); ++info) { |
| - if (info->creation_time > delete_begin_) { |
| - ++appcaches_to_be_deleted_count_; |
| - appcache_service_->DeleteAppCacheGroup( |
| - info->manifest_url, &appcache_deleted_callback_); |
| - } |
| - } |
| - } |
| - |
| - if (!appcaches_to_be_deleted_count_) |
| - OnClearedAppCache(); |
| - // else continues in OnAppCacheDeleted |
| -} |
| - |
| -void BrowsingDataRemover::OnAppCacheDeleted(int rv) { |
| - --appcaches_to_be_deleted_count_; |
| - if (!appcaches_to_be_deleted_count_) |
| - OnClearedAppCache(); |
| + appcache_service_->ClearAppCache(&appcache_cleared_callback_); |
|
michaeln
2011/07/14 00:42:34
The code in this CL isn't looking at the delete_be
marja(google)
2011/07/14 10:31:59
Ah, indeed, that's a bug. Thanks for pointing it o
michaeln
2011/07/14 22:53:16
...
|
| + // Continues in OnClearedAppCache. |
| } |
| void BrowsingDataRemover::ClearFileSystemsOnFILEThread() { |