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

Unified Diff: trunk/src/chrome/browser/extensions/extension_garbage_collector.cc

Issue 306023007: Revert 273763 "Add garbage collection for shared extensions on C..." (Closed) Base URL: svn://svn.chromium.org/chrome/
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
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);

Powered by Google App Engine
This is Rietveld 408576698