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

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: 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..066aba9267c9dbc1cbef1451ccb20ef02207f94a 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_patthen = id + "-*" + kCRXFileExtension;
asargent_no_longer_on_chrome 2014/05/15 17:49:01 nit: should this be "file_pattern" ?
jennyz 2014/05/15 18:51:22 Done.
+ base::FileEnumerator enumerator(cache_dir,
+ false /* not recursive */,
+ base::FileEnumerator::FILES,
+ file_patthen);
+ for (base::FilePath path = enumerator.Next(); !path.empty();
+ path = enumerator.Next()) {
+ CHECK(base::DeleteFile(path, false));
asargent_no_longer_on_chrome 2014/05/15 17:49:01 Is it appropriate to crash the whole browser if yo
jennyz 2014/05/15 18:51:22 Done.
+ 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