| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/browser_thread.h" | 7 #include "chrome/browser/browser_thread.h" |
| 8 #include "chrome/browser/net/chrome_url_request_context.h" | 8 #include "chrome/browser/net/chrome_url_request_context.h" |
| 9 #include "chrome/browser/profile.h" | 9 #include "chrome/browser/profile.h" |
| 10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 const GURL& manifest_url) { | 54 const GURL& manifest_url) { |
| 55 if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { | 55 if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
| 56 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, NewRunnableMethod( | 56 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, NewRunnableMethod( |
| 57 this, &BrowsingDataAppCacheHelper::DeleteAppCacheGroup, | 57 this, &BrowsingDataAppCacheHelper::DeleteAppCacheGroup, |
| 58 manifest_url)); | 58 manifest_url)); |
| 59 return; | 59 return; |
| 60 } | 60 } |
| 61 GetAppCacheService()->DeleteAppCacheGroup(manifest_url, NULL); | 61 GetAppCacheService()->DeleteAppCacheGroup(manifest_url, NULL); |
| 62 } | 62 } |
| 63 | 63 |
| 64 BrowsingDataAppCacheHelper::~BrowsingDataAppCacheHelper() {} |
| 65 |
| 64 void BrowsingDataAppCacheHelper::OnFetchComplete(int rv) { | 66 void BrowsingDataAppCacheHelper::OnFetchComplete(int rv) { |
| 65 if (BrowserThread::CurrentlyOn(BrowserThread::IO)) { | 67 if (BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
| 66 // Filter out appache info entries for extensions. Extension state is not | 68 // Filter out appache info entries for extensions. Extension state is not |
| 67 // considered browsing data. | 69 // considered browsing data. |
| 68 typedef std::map<GURL, appcache::AppCacheInfoVector> InfoByOrigin; | 70 typedef std::map<GURL, appcache::AppCacheInfoVector> InfoByOrigin; |
| 69 InfoByOrigin& origin_map = info_collection_->infos_by_origin; | 71 InfoByOrigin& origin_map = info_collection_->infos_by_origin; |
| 70 for (InfoByOrigin::iterator origin = origin_map.begin(); | 72 for (InfoByOrigin::iterator origin = origin_map.begin(); |
| 71 origin != origin_map.end();) { | 73 origin != origin_map.end();) { |
| 72 InfoByOrigin::iterator current = origin; | 74 InfoByOrigin::iterator current = origin; |
| 73 ++origin; | 75 ++origin; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 131 |
| 130 bool CannedBrowsingDataAppCacheHelper::empty() const { | 132 bool CannedBrowsingDataAppCacheHelper::empty() const { |
| 131 return info_collection_->infos_by_origin.empty(); | 133 return info_collection_->infos_by_origin.empty(); |
| 132 } | 134 } |
| 133 | 135 |
| 134 void CannedBrowsingDataAppCacheHelper::StartFetching( | 136 void CannedBrowsingDataAppCacheHelper::StartFetching( |
| 135 Callback0::Type* completion_callback) { | 137 Callback0::Type* completion_callback) { |
| 136 completion_callback->Run(); | 138 completion_callback->Run(); |
| 137 delete completion_callback; | 139 delete completion_callback; |
| 138 } | 140 } |
| 141 |
| 142 CannedBrowsingDataAppCacheHelper::~CannedBrowsingDataAppCacheHelper() {} |
| OLD | NEW |