Only run extension garbage collection when no CRX installations are currently in progress.
This should fix various race conditions where files of extensions could
get deleted while the extension was being installed.
To do this, ExtensionGarbageCollector depends on InstallTracker to be
informed whenever a CRX starts and finishes installing. To be able to
depend on InstallTracker, ExtensionGarbageCollector needed to be a
service of its own (which seems cleaner anyway).
BUG=342271
Review URL: https://codereview.chromium.org/228553005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264119 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/install_tracker.cc b/chrome/browser/extensions/install_tracker.cc
index 784ae81..9a61bd7 100644
--- a/chrome/browser/extensions/install_tracker.cc
+++ b/chrome/browser/extensions/install_tracker.cc
@@ -80,6 +80,12 @@
InstallObserver, observers_, OnBeginCrxInstall(extension_id));
}
+void InstallTracker::OnFinishCrxInstall(const std::string& extension_id,
+ bool success) {
+ FOR_EACH_OBSERVER(
+ InstallObserver, observers_, OnFinishCrxInstall(extension_id, success));
+}
+
void InstallTracker::OnInstallFailure(
const std::string& extension_id) {
FOR_EACH_OBSERVER(InstallObserver, observers_,