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

Side by Side Diff: chrome/browser/browsing_data_appcache_helper.cc

Issue 8775034: base::Bind: Convert AppCacheHelper::DeleteAppCacheGroup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | webkit/appcache/appcache_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/browsing_data_appcache_helper.h" 5 #include "chrome/browser/browsing_data_appcache_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "chrome/browser/net/chrome_url_request_context.h" 9 #include "chrome/browser/net/chrome_url_request_context.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 void BrowsingDataAppCacheHelper::DeleteAppCacheGroup( 57 void BrowsingDataAppCacheHelper::DeleteAppCacheGroup(
58 const GURL& manifest_url) { 58 const GURL& manifest_url) {
59 if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { 59 if (BrowserThread::CurrentlyOn(BrowserThread::UI)) {
60 BrowserThread::PostTask( 60 BrowserThread::PostTask(
61 BrowserThread::IO, FROM_HERE, 61 BrowserThread::IO, FROM_HERE,
62 base::Bind(&BrowsingDataAppCacheHelper::DeleteAppCacheGroup, this, 62 base::Bind(&BrowsingDataAppCacheHelper::DeleteAppCacheGroup, this,
63 manifest_url)); 63 manifest_url));
64 return; 64 return;
65 } 65 }
66 appcache_service_->DeleteAppCacheGroup(manifest_url, NULL); 66
67 appcache_service_->DeleteAppCacheGroup(
68 manifest_url, net::CompletionCallback());
67 } 69 }
68 70
69 BrowsingDataAppCacheHelper::~BrowsingDataAppCacheHelper() {} 71 BrowsingDataAppCacheHelper::~BrowsingDataAppCacheHelper() {}
70 72
71 void BrowsingDataAppCacheHelper::OnFetchComplete(int rv) { 73 void BrowsingDataAppCacheHelper::OnFetchComplete(int rv) {
72 if (BrowserThread::CurrentlyOn(BrowserThread::IO)) { 74 if (BrowserThread::CurrentlyOn(BrowserThread::IO)) {
73 // Filter out appache info entries for extensions. Extension state is not 75 // Filter out appcache info entries for extensions. Extension state is not
74 // considered browsing data. 76 // considered browsing data.
75 typedef std::map<GURL, appcache::AppCacheInfoVector> InfoByOrigin; 77 typedef std::map<GURL, appcache::AppCacheInfoVector> InfoByOrigin;
76 InfoByOrigin& origin_map = info_collection_->infos_by_origin; 78 InfoByOrigin& origin_map = info_collection_->infos_by_origin;
77 for (InfoByOrigin::iterator origin = origin_map.begin(); 79 for (InfoByOrigin::iterator origin = origin_map.begin();
78 origin != origin_map.end();) { 80 origin != origin_map.end();) {
79 InfoByOrigin::iterator current = origin; 81 InfoByOrigin::iterator current = origin;
80 ++origin; 82 ++origin;
81 if (current->first.SchemeIs(chrome::kExtensionScheme)) 83 if (current->first.SchemeIs(chrome::kExtensionScheme))
82 origin_map.erase(current); 84 origin_map.erase(current);
83 } 85 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 bool CannedBrowsingDataAppCacheHelper::empty() const { 140 bool CannedBrowsingDataAppCacheHelper::empty() const {
139 return info_collection_->infos_by_origin.empty(); 141 return info_collection_->infos_by_origin.empty();
140 } 142 }
141 143
142 void CannedBrowsingDataAppCacheHelper::StartFetching( 144 void CannedBrowsingDataAppCacheHelper::StartFetching(
143 const base::Closure& completion_callback) { 145 const base::Closure& completion_callback) {
144 completion_callback.Run(); 146 completion_callback.Run();
145 } 147 }
146 148
147 CannedBrowsingDataAppCacheHelper::~CannedBrowsingDataAppCacheHelper() {} 149 CannedBrowsingDataAppCacheHelper::~CannedBrowsingDataAppCacheHelper() {}
OLDNEW
« no previous file with comments | « no previous file | webkit/appcache/appcache_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698