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

Unified Diff: chrome/browser/extensions/updater/local_extension_cache.cc

Issue 285253002: kiosk: Remove all cached CRX when removing a kiosk app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix a typo and remove CHECK for deleting files. Created 6 years, 7 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/extensions/updater/local_extension_cache.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/updater/local_extension_cache.cc
diff --git a/chrome/browser/extensions/updater/local_extension_cache.cc b/chrome/browser/extensions/updater/local_extension_cache.cc
index b6bb926ae5adbe075997e0e5a0c3ce6b9ab12e49..add6cdd70add6fc988a9e1f3a9d14ad4ab467789 100644
--- a/chrome/browser/extensions/updater/local_extension_cache.cc
+++ b/chrome/browser/extensions/updater/local_extension_cache.cc
@@ -145,8 +145,8 @@ bool LocalExtensionCache::RemoveExtension(const std::string& id) {
backend_task_runner_->PostTask(
FROM_HERE,
- base::Bind(&LocalExtensionCache::BackendRemoveCacheEntry,
- it->second.file_path));
+ base::Bind(
+ &LocalExtensionCache::BackendRemoveCacheEntry, cache_dir_, id));
cached_extensions_.erase(it);
return true;
@@ -438,9 +438,18 @@ void LocalExtensionCache::OnCacheEntryInstalled(
// static
void LocalExtensionCache::BackendRemoveCacheEntry(
- const base::FilePath& file_path) {
- base::DeleteFile(file_path, true /* recursive */);
- VLOG(1) << "Removed cached file " << file_path.value();
+ const base::FilePath& cache_dir,
+ const std::string& id) {
+ std::string file_pattern = id + "-*" + kCRXFileExtension;
+ base::FileEnumerator enumerator(cache_dir,
+ false /* not recursive */,
+ base::FileEnumerator::FILES,
+ file_pattern);
+ for (base::FilePath path = enumerator.Next(); !path.empty();
+ path = enumerator.Next()) {
+ base::DeleteFile(path, false);
+ VLOG(1) << "Removed cached file " << path.value();
+ }
}
// static
« no previous file with comments | « chrome/browser/extensions/updater/local_extension_cache.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698