diff options
author | koz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-28 00:41:51 +0000 |
---|---|---|
committer | koz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-28 00:41:51 +0000 |
commit | 466cb92c1cfa1e78613ed8ca3bac381fcf227280 (patch) | |
tree | 5e76b57d8dd7b0ab6f35ffeafa1d369d83915f53 /chrome/browser/extensions | |
parent | 07a0cc3cd3ebb314f81c18e3c64ae1f270fd6415 (diff) | |
download | chromium_src-466cb92c1cfa1e78613ed8ca3bac381fcf227280.zip chromium_src-466cb92c1cfa1e78613ed8ca3bac381fcf227280.tar.gz chromium_src-466cb92c1cfa1e78613ed8ca3bac381fcf227280.tar.bz2 |
Don't re-get InstallTracker in AppsModelBuilder.
Currently the destructor for AppsModelBuilder tries to reacquire InstallTracker
via its factory, but at that point the service has been Shutdown().
Review URL: https://codereview.chromium.org/12377002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185086 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r-- | chrome/browser/extensions/install_observer.h | 3 | ||||
-rw-r--r-- | chrome/browser/extensions/install_tracker.cc | 4 | ||||
-rw-r--r-- | chrome/browser/extensions/install_tracker.h | 3 |
3 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/extensions/install_observer.h b/chrome/browser/extensions/install_observer.h index c221be0..d222062 100644 --- a/chrome/browser/extensions/install_observer.h +++ b/chrome/browser/extensions/install_observer.h @@ -24,6 +24,9 @@ class InstallObserver { virtual void OnInstallFailure(const std::string& extension_id) = 0; + // Notifies observers that the observed object is going away. + virtual void OnShutdown() = 0; + protected: virtual ~InstallObserver() {} }; diff --git a/chrome/browser/extensions/install_tracker.cc b/chrome/browser/extensions/install_tracker.cc index 3d0b984..de91234 100644 --- a/chrome/browser/extensions/install_tracker.cc +++ b/chrome/browser/extensions/install_tracker.cc @@ -44,4 +44,8 @@ void InstallTracker::OnInstallFailure( OnInstallFailure(extension_id)); } +void InstallTracker::Shutdown() { + FOR_EACH_OBSERVER(InstallObserver, observers_, OnShutdown()); +} + } // namespace extensions diff --git a/chrome/browser/extensions/install_tracker.h b/chrome/browser/extensions/install_tracker.h index a15dd53..d82646f 100644 --- a/chrome/browser/extensions/install_tracker.h +++ b/chrome/browser/extensions/install_tracker.h @@ -32,6 +32,9 @@ class InstallTracker : public ProfileKeyedService { int percent_downloaded); void OnInstallFailure(const std::string& extension_id); + // Overriddes for ProfileKeyedService: + void Shutdown(); + private: ObserverList<InstallObserver> observers_; |