Chromium Code Reviews| Index: chrome/browser/extensions/extension_service.h |
| diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h |
| index 6e2d1b7d7aa307a38beb88821e336d90c50454bc..20ca927f8cc55fd619579b0bc42e05cd4ea97cf1 100644 |
| --- a/chrome/browser/extensions/extension_service.h |
| +++ b/chrome/browser/extensions/extension_service.h |
| @@ -327,6 +327,10 @@ class ExtensionService |
| const extensions::Extension* GetExtensionById(const std::string& id, |
| int include_mask) const; |
| + // Returns the site of the given |extension_id|. Suitable for use with |
| + // BrowserContext::GetStoragePartitionForSite() |
| + GURL GetSiteForExtensionId(const std::string& extension_id); |
| + |
| // Looks up a terminated (crashed) extension by ID. |
| const extensions::Extension* |
| GetTerminatedExtension(const std::string& id) const; |
| @@ -778,10 +782,9 @@ class ExtensionService |
| // the extension is installed, e.g., to update event handlers on background |
| // pages; and perform other extension install tasks before calling |
| // AddExtension. |
| - void AddNewOrUpdatedExtension( |
| - const extensions::Extension* extension, |
| - const syncer::StringOrdinal& page_ordinal, |
| - extensions::Extension::State initial_state); |
| + void AddNewOrUpdatedExtension(const extensions::Extension* extension, |
| + extensions::Extension::State initial_state, |
| + const syncer::StringOrdinal& page_ordinal); |
| // Handles sending notification that |extension| was loaded. |
| void NotifyExtensionLoaded(const extensions::Extension* extension); |
| @@ -845,6 +848,12 @@ 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(); |
| + void OnNeedsToGarbageCollectedIsolatedStorage(); |
| + |
| // extensions::Blacklist::Observer implementation. |
| virtual void OnBlacklistUpdated() OVERRIDE; |
| @@ -853,6 +862,10 @@ class ExtensionService |
| void ManageBlacklist(const std::set<std::string>& old_blacklisted_ids, |
| const std::set<std::string>& new_blacklisted_ids); |
| + // Controls if installs are delayed. See comment for |installs_delayed_|. |
| + void set_installs_delayed(bool value) { installs_delayed_ = value; } |
| + bool installs_delayed() const { return installs_delayed_; } |
| + |
| // The normal profile associated with this ExtensionService. |
| Profile* profile_; |
| @@ -883,8 +896,14 @@ class ExtensionService |
| // they can easily be un-blacklisted. |
| ExtensionSet blacklisted_extensions_; |
| - // The list of extension updates that are waiting to be installed. |
| - ExtensionSet pending_extension_updates_; |
| + // The list of extension updates that have had their installs delayed because |
| + // they are waiting for idle. |
| + ExtensionSet delayed_for_idle_updates_; |
|
Matt Perry
2012/12/08 01:55:33
nit: delayed_updates_for_idle_
(otherwise it sound
awong
2012/12/08 02:11:09
Done.
|
| + |
| + // The list of extension installs delayed by |installs_delayed_|. |
| + // This is a disjoint set from |delayed_for_idle_updates_|. Extensions in |
| + // the |delayed_installs_| do not need to wait for idle. |
| + ExtensionSet delayed_installs_; |
| // Hold the set of pending extensions. |
| extensions::PendingExtensionManager pending_extension_manager_; |
| @@ -1002,6 +1021,12 @@ class ExtensionService |
| // decide to abort. |
| bool browser_terminating_; |
| + // Set to true to delay all new extension installations. Acts as a lock |
| + // to allow background processing of tasks such as garbage collection of |
| + // on-disk state without needing to worry about race conditions caused |
| + // by extension installation and reinstallation. |
| + bool installs_delayed_; |
| + |
| NaClModuleInfoList nacl_module_list_; |
| extensions::AppSyncBundle app_sync_bundle_; |