Chromium Code Reviews| 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 |