Index: chrome/browser/extensions/extension_service.h |
diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h |
index 266f47c5ecbd224891c1d9eedeed8955b41bdd0a..2c02b4f9059d231e170343e5263bdefbfd9367a3 100644 |
--- a/chrome/browser/extensions/extension_service.h |
+++ b/chrome/browser/extensions/extension_service.h |
@@ -51,6 +51,7 @@ class BrowserEventRouter; |
class ComponentLoader; |
class CrxInstaller; |
class ExtensionActionStorageManager; |
+class ExtensionGarbageCollector; |
class ExtensionRegistry; |
class ExtensionSystem; |
class ExtensionToolbarModel; |
@@ -271,9 +272,6 @@ class ExtensionService |
// Reloads all extensions. Does not notify that extensions are ready. |
void ReloadExtensionsForTest(); |
- // Scan the extension directory and clean up the cruft. |
- void GarbageCollectExtensions(); |
- |
// Returns true if |url| should get extension api bindings and be permitted |
// to make api calls. Note that this is independent of what extension |
// permissions the given extension has been granted. |
@@ -486,6 +484,14 @@ class ExtensionService |
const content::NotificationSource& source, |
const content::NotificationDetails& details) OVERRIDE; |
+ // Postpone installations so that we don't have to worry about race |
+ // conditions. |
+ void OnGarbageCollectIsolatedStorageStart(); |
+ |
+ // Restart any extension installs which were delayed for isolated storage |
+ // garbage collection. |
+ void OnGarbageCollectIsolatedStorageFinished(); |
+ |
// Record a histogram using the PermissionMessage enum values for each |
// permission in |e|. |
// NOTE: If this is ever called with high frequency, the implementation may |
@@ -505,6 +511,10 @@ class ExtensionService |
base::WeakPtr<ExtensionService> AsWeakPtr() { return base::AsWeakPtr(this); } |
+ extensions::ExtensionGarbageCollector* garbage_collector() { |
+ return garbage_collector_.get(); |
+ } |
+ |
bool browser_terminating() const { return browser_terminating_; } |
// For testing. |
@@ -530,15 +540,6 @@ class ExtensionService |
void AddUpdateObserver(extensions::UpdateObserver* observer); |
void RemoveUpdateObserver(extensions::UpdateObserver* observer); |
-#if defined(OS_CHROMEOS) |
- void disable_garbage_collection() { |
- disable_garbage_collection_ = true; |
- } |
- void enable_garbage_collection() { |
- disable_garbage_collection_ = false; |
- } |
-#endif |
- |
private: |
// Populates greylist_. |
void LoadGreylistFromPrefs(); |
@@ -600,11 +601,6 @@ class ExtensionService |
bool ShouldDelayExtensionUpdate(const std::string& extension_id, |
bool wait_for_idle) const; |
- // Helper to search storage directories for extensions with isolated storage |
- // that have been orphaned by an uninstall. |
- void GarbageCollectIsolatedStorage(); |
- void OnGarbageCollectIsolatedStorageFinished(); |
- |
// extensions::Blacklist::Observer implementation. |
virtual void OnBlacklistUpdated() OVERRIDE; |
@@ -623,13 +619,6 @@ class ExtensionService |
const ExtensionIdSet& unchanged, |
const extensions::Blacklist::BlacklistStateMap& state_map); |
- // Controls if installs are delayed. See comment for |
- // |installs_delayed_for_gc_|. |
- void set_installs_delayed_for_gc(bool value) { |
- installs_delayed_for_gc_ = value; |
- } |
- bool installs_delayed_for_gc() const { return installs_delayed_for_gc_; } |
- |
// Used only by test code. |
void UnloadAllExtensionsInternal(); |
@@ -759,15 +748,11 @@ class ExtensionService |
scoped_ptr<extensions::ManagementPolicy::Provider> |
shared_module_policy_provider_; |
- ObserverList<extensions::UpdateObserver, true> update_observers_; |
+ // The ExtensionGarbageCollector to clean up all the garbage that leaks into |
+ // the extensions directory. |
+ scoped_ptr<extensions::ExtensionGarbageCollector> garbage_collector_; |
-#if defined(OS_CHROMEOS) |
- // TODO(rkc): HACK alert - this is only in place to allow the |
- // kiosk_mode_screensaver to prevent its extension from getting garbage |
- // collected. Remove this once KioskModeScreensaver is removed. |
- // See crbug.com/280363 |
- bool disable_garbage_collection_; |
-#endif |
+ ObserverList<extensions::UpdateObserver, true> update_observers_; |
FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
InstallAppsWithUnlimtedStorage); |