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

Unified Diff: chrome/browser/plugins/plugin_installer.cc

Issue 22918027: Remove calls to ObserverList::size() from PluginInstaller. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/plugins/plugin_installer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugins/plugin_installer.cc
diff --git a/chrome/browser/plugins/plugin_installer.cc b/chrome/browser/plugins/plugin_installer.cc
index 099711e2b751be04a885ed523c5c8671490a794f..6801d13b2454348f41ec0490cc52aeb1ce23ee9f 100644
--- a/chrome/browser/plugins/plugin_installer.cc
+++ b/chrome/browser/plugins/plugin_installer.cc
@@ -67,7 +67,8 @@ void BeginDownload(
} // namespace
PluginInstaller::PluginInstaller()
- : state_(INSTALLER_STATE_IDLE) {
+ : state_(INSTALLER_STATE_IDLE),
+ strong_observer_count_(0) {
}
PluginInstaller::~PluginInstaller() {
@@ -109,12 +110,14 @@ void PluginInstaller::OnDownloadDestroyed(DownloadItem* download) {
}
void PluginInstaller::AddObserver(PluginInstallerObserver* observer) {
+ strong_observer_count_++;
observers_.AddObserver(observer);
}
void PluginInstaller::RemoveObserver(PluginInstallerObserver* observer) {
+ strong_observer_count_--;
observers_.RemoveObserver(observer);
- if (observers_.size() == weak_observers_.size()) {
+ if (strong_observer_count_ == 0) {
FOR_EACH_OBSERVER(WeakPluginInstallerObserver, weak_observers_,
OnlyWeakObserversLeft());
}
« no previous file with comments | « chrome/browser/plugins/plugin_installer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698