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

Unified Diff: chrome/browser/browsing_data_remover.cc

Issue 7311001: Not posting appcache cleaning task if there is no appcache service. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Code review; style fixes. Created 9 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0b34523641b4738584f852c6eb4ebb184eeeb40a 100644
--- a/chrome/browser/browsing_data_remover.cc
+++ b/chrome/browser/browsing_data_remover.cc
@@ -66,7 +66,6 @@ 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_(
@@ -225,12 +224,15 @@ void BrowsingDataRemover::Remove(int remove_mask) {
&BrowsingDataRemover::ClearDatabasesOnFILEThread));
}
- waiting_for_clear_appcache_ = true;
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- NewRunnableMethod(
- this,
- &BrowsingDataRemover::ClearAppCacheOnIOThread));
+ appcache_service_ = profile_->GetAppCacheService();
+ if (appcache_service_.get()) {
+ waiting_for_clear_appcache_ = true;
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ NewRunnableMethod(
+ this,
+ &BrowsingDataRemover::ClearAppCacheOnIOThread));
+ }
waiting_for_clear_gears_data_ = true;
BrowserThread::PostTask(
@@ -527,14 +529,9 @@ 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
- } else {
- // Couldn't get app cache service, nothing to clear.
- OnClearedAppCache();
- }
+ appcache_service_->GetAllAppCacheInfo(
+ appcache_info_, &appcache_got_info_callback_);
+ // continues in OnGotAppCacheInfo.
}
void BrowsingDataRemover::OnGotAppCacheInfo(int rv) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698