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

Unified Diff: chrome/browser/extensions/extensions_service.cc

Issue 4957005: Move themes garbage-collection out of shutdown code. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Addressed asargent's comments Created 10 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/themes/browser_theme_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extensions_service.cc
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index 05c6768a9d6e3ac6ed15d2559bb06511fa6a36b3..3c061d3400e26606fe074414888c53d6c7cdd0ca 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -21,6 +21,7 @@
#include "base/values.h"
#include "base/version.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/themes/browser_theme_provider.h"
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/debugger/devtools_manager.h"
#include "chrome/browser/dom_ui/shown_sections_handler.h"
@@ -1460,6 +1461,13 @@ void ExtensionsService::GarbageCollectExtensions() {
NewRunnableFunction(
&extension_file_util::GarbageCollectExtensions, install_directory_,
extension_paths));
+
+ // Also garbage-collect themes. We check |profile_| to be
+ // defensive; in the future, we may call GarbageCollectExtensions()
+ // from somewhere other than Init() (e.g., in a timer).
+ if (profile_) {
+ profile_->GetThemeProvider()->RemoveUnusedThemes();
+ }
}
void ExtensionsService::OnLoadedInstalledExtensions() {
« no previous file with comments | « no previous file | chrome/browser/themes/browser_theme_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698