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

Unified Diff: chrome/browser/extensions/extension_service.h

Issue 11419307: Garbage Collect the Storage directory on next profile start after an extension uninstall. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address mpcomplete's comments Created 8 years 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_service.h
diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h
index 6e2d1b7d7aa307a38beb88821e336d90c50454bc..c4dc1919a431ff90dec207dc32e2edd4db51c84a 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()
Charlie Reis 2012/12/10 23:22:28 nit: End with period.
awong 2012/12/11 01:18:32 Done.
+ 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 OnNeedsToGarbageCollectIsolatedStorage();
+
// 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_updates_for_idle_;
+
+ // The list of extension installs delayed by |installs_delayed_|.
+ // This is a disjoint set from |delayed_updates_for_idle_|. 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_;

Powered by Google App Engine
This is Rietveld 408576698