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

Unified Diff: chrome/browser/browsing_data_remover.cc

Issue 7290025: BrowsingDataRemover: Getting ChromeAppCacheService directly from Profile. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Not allowed to access profile_ on IO thread. Caching the ChromeAppCacheService. Created 9 years, 6 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 | « chrome/browser/browsing_data_remover.h ('k') | 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 9a42c40116478c6508d3faeebcaf056de881a0ca..b572cd42805d1b0c225835c2655ba3a16ebbaa79 100644
--- a/chrome/browser/browsing_data_remover.cc
+++ b/chrome/browser/browsing_data_remover.cc
@@ -66,6 +66,7 @@ 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_(
@@ -526,8 +527,8 @@ void BrowsingDataRemover::ClearAppCacheOnIOThread() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(waiting_for_clear_appcache_);
appcache_info_ = new appcache::AppCacheInfoCollection;
- if (GetAppCacheService()) {
- GetAppCacheService()->GetAllAppCacheInfo(
+ if (appcache_service_) {
+ appcache_service_->GetAllAppCacheInfo(
appcache_info_, &appcache_got_info_callback_);
// continues in OnGotAppCacheInfo
} else {
@@ -549,7 +550,7 @@ void BrowsingDataRemover::OnGotAppCacheInfo(int rv) {
info != origin->second.end(); ++info) {
if (info->creation_time > delete_begin_) {
++appcaches_to_be_deleted_count_;
- GetAppCacheService()->DeleteAppCacheGroup(
+ appcache_service_->DeleteAppCacheGroup(
info->manifest_url, &appcache_deleted_callback_);
}
}
@@ -566,16 +567,6 @@ void BrowsingDataRemover::OnAppCacheDeleted(int rv) {
OnClearedAppCache();
}
-ChromeAppCacheService* BrowsingDataRemover::GetAppCacheService() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- ChromeURLRequestContext* request_context = NULL;
- if (main_context_getter_)
- request_context = reinterpret_cast<ChromeURLRequestContext*>(
- main_context_getter_->GetURLRequestContext());
- return request_context ? request_context->appcache_service()
- : NULL;
-}
-
void BrowsingDataRemover::ClearFileSystemsOnFILEThread() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DCHECK(waiting_for_clear_file_systems_);
« no previous file with comments | « chrome/browser/browsing_data_remover.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698