| Index: chrome/browser/extensions/extension_garbage_collector.cc
|
| diff --git a/chrome/browser/extensions/extension_garbage_collector.cc b/chrome/browser/extensions/extension_garbage_collector.cc
|
| index 54198736b48fc462236311bfbb357a91de641e14..4469b4caf043985056e89c4322da2752d40d6c50 100644
|
| --- a/chrome/browser/extensions/extension_garbage_collector.cc
|
| +++ b/chrome/browser/extensions/extension_garbage_collector.cc
|
| @@ -95,34 +95,11 @@ void CheckExtensionDirectory(const base::FilePath& path,
|
| }
|
| }
|
|
|
| -void GarbageCollectExtensionsOnFileThread(
|
| - const base::FilePath& install_directory,
|
| - const ExtensionPathsMultimap& extension_paths) {
|
| - DCHECK(!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
|
| -
|
| - // Nothing to clean up if it doesn't exist.
|
| - if (!base::DirectoryExists(install_directory))
|
| - return;
|
| -
|
| - base::FileEnumerator enumerator(install_directory,
|
| - false, // Not recursive.
|
| - base::FileEnumerator::DIRECTORIES);
|
| -
|
| - for (base::FilePath extension_path = enumerator.Next();
|
| - !extension_path.empty();
|
| - extension_path = enumerator.Next()) {
|
| - CheckExtensionDirectory(extension_path, extension_paths);
|
| - }
|
| -}
|
| -
|
| } // namespace
|
|
|
| ExtensionGarbageCollector::ExtensionGarbageCollector(
|
| content::BrowserContext* context)
|
| : context_(context), crx_installs_in_progress_(0), weak_factory_(this) {
|
| -#if defined(OS_CHROMEOS)
|
| - disable_garbage_collection_ = false;
|
| -#endif
|
|
|
| ExtensionSystem* extension_system = ExtensionSystem::Get(context_);
|
| DCHECK(extension_system);
|
| @@ -158,13 +135,29 @@ void ExtensionGarbageCollector::GarbageCollectExtensionsForTest() {
|
| GarbageCollectExtensions();
|
| }
|
|
|
| -void ExtensionGarbageCollector::GarbageCollectExtensions() {
|
| - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
|
| +// static
|
| +void ExtensionGarbageCollector::GarbageCollectExtensionsOnFileThread(
|
| + const base::FilePath& install_directory,
|
| + const ExtensionPathsMultimap& extension_paths) {
|
| + DCHECK(!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
|
|
|
| -#if defined(OS_CHROMEOS)
|
| - if (disable_garbage_collection_)
|
| + // Nothing to clean up if it doesn't exist.
|
| + if (!base::DirectoryExists(install_directory))
|
| return;
|
| -#endif
|
| +
|
| + base::FileEnumerator enumerator(install_directory,
|
| + false, // Not recursive.
|
| + base::FileEnumerator::DIRECTORIES);
|
| +
|
| + for (base::FilePath extension_path = enumerator.Next();
|
| + !extension_path.empty();
|
| + extension_path = enumerator.Next()) {
|
| + CheckExtensionDirectory(extension_path, extension_paths);
|
| + }
|
| +}
|
| +
|
| +void ExtensionGarbageCollector::GarbageCollectExtensions() {
|
| + DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
|
|
|
| ExtensionPrefs* extension_prefs = ExtensionPrefs::Get(context_);
|
| DCHECK(extension_prefs);
|
|
|