| Index: trunk/src/chrome/browser/extensions/extension_garbage_collector.cc
|
| ===================================================================
|
| --- trunk/src/chrome/browser/extensions/extension_garbage_collector.cc (revision 273797)
|
| +++ trunk/src/chrome/browser/extensions/extension_garbage_collector.cc (working copy)
|
| @@ -96,11 +96,34 @@
|
| }
|
| }
|
|
|
| +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);
|
| @@ -136,30 +159,14 @@
|
| GarbageCollectExtensions();
|
| }
|
|
|
| -// static
|
| -void ExtensionGarbageCollector::GarbageCollectExtensionsOnFileThread(
|
| - const base::FilePath& install_directory,
|
| - const ExtensionPathsMultimap& extension_paths) {
|
| - DCHECK(!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
|
| +void ExtensionGarbageCollector::GarbageCollectExtensions() {
|
| + DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
|
|
|
| - // Nothing to clean up if it doesn't exist.
|
| - if (!base::DirectoryExists(install_directory))
|
| +#if defined(OS_CHROMEOS)
|
| + if (disable_garbage_collection_)
|
| 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);
|
|
|
|
|