Index: chrome/browser/extensions/extension_service.cc |
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc |
index fac49f28d5d64d1bae52185f2c766a52f764ca9a..edad2907856a78f8418e08b93ff02dbdb9fd5e7e 100644 |
--- a/chrome/browser/extensions/extension_service.cc |
+++ b/chrome/browser/extensions/extension_service.cc |
@@ -180,6 +180,9 @@ static const int kMaxExtensionAcknowledgePromptCount = 3; |
// Wait this many seconds after an extensions becomes idle before updating it. |
static const int kUpdateIdleDelay = 5; |
+// Wait this many seconds before trying to garbage collect extensions again. |
+static const int kGarbageCollectRetryDelay = 30; |
James Cook
2012/11/28 18:15:29
optional nit: Constants in anonymous namespace don
|
+ |
const char* kNaClPluginMimeType = "application/x-nacl"; |
static bool IsSyncableExtension(const Extension& extension) { |
@@ -1994,6 +1997,17 @@ void ExtensionService::GarbageCollectExtensions() { |
if (extension_prefs_->pref_service()->ReadOnly()) |
return; |
+ if (pending_extension_manager()->HasPendingExtensions()) { |
+ // Don't garbage collect while there are pending installations, which may |
+ // be using the temporary installation directory. Try to garbage collect |
+ // again later. |
+ MessageLoop::current()->PostDelayedTask( |
+ FROM_HERE, |
+ base::Bind(&ExtensionService::GarbageCollectExtensions, AsWeakPtr()), |
+ base::TimeDelta::FromSeconds(kGarbageCollectRetryDelay)); |
+ return; |
+ } |
+ |
scoped_ptr<extensions::ExtensionPrefs::ExtensionsInfo> info( |
extension_prefs_->GetInstalledExtensionsInfo()); |