| Index: chrome/browser/browsing_data_remover.cc
|
| diff --git a/chrome/browser/browsing_data_remover.cc b/chrome/browser/browsing_data_remover.cc
|
| index b572cd42805d1b0c225835c2655ba3a16ebbaa79..9b99a4cf2b164f221c14b7f4439061a5b65d176b 100644
|
| --- a/chrome/browser/browsing_data_remover.cc
|
| +++ b/chrome/browser/browsing_data_remover.cc
|
| @@ -66,12 +66,8 @@ BrowsingDataRemover::BrowsingDataRemover(Profile* profile,
|
| this, &BrowsingDataRemover::OnClearedDatabases)),
|
| ALLOW_THIS_IN_INITIALIZER_LIST(cache_callback_(
|
| this, &BrowsingDataRemover::DoClearCache)),
|
| - appcache_service_(profile->GetAppCacheService()),
|
| - 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 +93,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()),
|
| @@ -511,11 +504,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;
|
| }
|
| @@ -526,47 +519,15 @@ void BrowsingDataRemover::OnClearedAppCache() {
|
| void BrowsingDataRemover::ClearAppCacheOnIOThread() {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| DCHECK(waiting_for_clear_appcache_);
|
| - appcache_info_ = new appcache::AppCacheInfoCollection;
|
| if (appcache_service_) {
|
| - appcache_service_->GetAllAppCacheInfo(
|
| - appcache_info_, &appcache_got_info_callback_);
|
| - // continues in OnGotAppCacheInfo
|
| + appcache_service_->ClearAppCache(&appcache_cleared_callback_);
|
| + // continues in OnClearedAppCache
|
| } else {
|
| // Couldn't get app cache service, nothing to clear.
|
| - OnClearedAppCache();
|
| + OnClearedAppCache(0);
|
| }
|
| }
|
|
|
| -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();
|
| -}
|
| -
|
| void BrowsingDataRemover::ClearFileSystemsOnFILEThread() {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
|
| DCHECK(waiting_for_clear_file_systems_);
|
|
|