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

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

Issue 303693011: Add garbage collection for shared extensions on Chrome OS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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: 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);

Powered by Google App Engine
This is Rietveld 408576698