Commit 2e0de835 authored by tzik@chromium.org's avatar tzik@chromium.org

[Extension] Protect all installed extension from extension storage GC

ExtensionGarbageCollector collects isolated storages of disabled apps as garbages,
this may cause unexpected data loss for temporarily disabled extensions.
This CL protects non-enabled installed app's isolated storage from GC.

BUG=328637
R=ajwong@chromium.org, mek@chromium.org, rdevlin.cronin@chromium.org

Review URL: https://codereview.chromium.org/247113002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266473 0039d316-1c4b-4281-b951-d872f2087c98
parent 092900de
......@@ -220,10 +220,10 @@ void ExtensionGarbageCollector::GarbageCollectIsolatedStorageIfNeeded() {
scoped_ptr<base::hash_set<base::FilePath> > active_paths(
new base::hash_set<base::FilePath>());
const ExtensionSet& extensions =
ExtensionRegistry::Get(context_)->enabled_extensions();
for (ExtensionSet::const_iterator iter = extensions.begin();
iter != extensions.end();
scoped_ptr<ExtensionSet> extensions =
ExtensionRegistry::Get(context_)->GenerateInstalledExtensionsSet();
for (ExtensionSet::const_iterator iter = extensions->begin();
iter != extensions->end();
++iter) {
if (AppIsolationInfo::HasIsolatedStorage(iter->get())) {
active_paths->insert(
......
......@@ -60,9 +60,9 @@ class ExtensionGarbageCollector : public KeyedService, public InstallObserver {
// removed iff there are no pending installations.
void GarbageCollectExtensions();
// Garbage collects apps/extensions isolated storage, if it is not currently
// active (i.e. is not in ExtensionRegistry::ENABLED). There is an exception
// for ephemeral apps, because they can outlive their cache lifetimes.
// Garbage collects apps/extensions isolated storage if it is uninstalled.
// There is an exception for ephemeral apps because they can outlive their
// cache lifetimes.
void GarbageCollectIsolatedStorageIfNeeded();
// The BrowserContext associated with the GarbageCollector.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment