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

Side by Side Diff: chrome/browser/extensions/extension_garbage_collector.cc

Issue 242203002: Don't garbage collect storage for disabled and crashed extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_garbage_collector.h" 5 #include "chrome/browser/extensions/extension_garbage_collector.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_enumerator.h" 9 #include "base/files/file_enumerator.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 213 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
214 214
215 ExtensionPrefs* extension_prefs = ExtensionPrefs::Get(context_); 215 ExtensionPrefs* extension_prefs = ExtensionPrefs::Get(context_);
216 DCHECK(extension_prefs); 216 DCHECK(extension_prefs);
217 if (!extension_prefs->NeedsStorageGarbageCollection()) 217 if (!extension_prefs->NeedsStorageGarbageCollection())
218 return; 218 return;
219 extension_prefs->SetNeedsStorageGarbageCollection(false); 219 extension_prefs->SetNeedsStorageGarbageCollection(false);
220 220
221 scoped_ptr<base::hash_set<base::FilePath> > active_paths( 221 scoped_ptr<base::hash_set<base::FilePath> > active_paths(
222 new base::hash_set<base::FilePath>()); 222 new base::hash_set<base::FilePath>());
223 const ExtensionSet& extensions = 223 scoped_ptr<ExtensionSet> extensions =
224 ExtensionRegistry::Get(context_)->enabled_extensions(); 224 ExtensionRegistry::Get(context_)->GenerateInstalledExtensionsSet();
awong 2014/04/21 17:54:19 Can you update the comment in the .h file to match
225 for (ExtensionSet::const_iterator iter = extensions.begin(); 225 for (ExtensionSet::const_iterator iter = extensions->begin();
226 iter != extensions.end(); 226 iter != extensions->end();
227 ++iter) { 227 ++iter) {
228 if (AppIsolationInfo::HasIsolatedStorage(iter->get())) { 228 if (AppIsolationInfo::HasIsolatedStorage(iter->get())) {
229 active_paths->insert( 229 active_paths->insert(
230 content::BrowserContext::GetStoragePartitionForSite( 230 content::BrowserContext::GetStoragePartitionForSite(
231 context_, util::GetSiteForExtensionId((*iter)->id(), context_)) 231 context_, util::GetSiteForExtensionId((*iter)->id(), context_))
232 ->GetPath()); 232 ->GetPath());
233 } 233 }
234 } 234 }
235 235
236 // The data of ephemeral apps can outlive their cache lifetime. Ensure 236 // The data of ephemeral apps can outlive their cache lifetime. Ensure
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 // accounting. 271 // accounting.
272 NOTREACHED(); 272 NOTREACHED();
273 273
274 // Don't let the count go negative to avoid garbage collecting when 274 // Don't let the count go negative to avoid garbage collecting when
275 // an install is actually in progress. 275 // an install is actually in progress.
276 crx_installs_in_progress_ = 0; 276 crx_installs_in_progress_ = 0;
277 } 277 }
278 } 278 }
279 279
280 } // namespace extensions 280 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698