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

Unified Diff: base/observer_list.h

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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 | « base/metrics/histogram.h ('k') | base/observer_list_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/observer_list.h
diff --git a/base/observer_list.h b/base/observer_list.h
index c77ec15b1db6b692da42e091556fffe618c4d5a5..ef45269ed6e60ea3b4a63342ca474318c6521906 100644
--- a/base/observer_list.h
+++ b/base/observer_list.h
@@ -100,7 +100,8 @@ class ObserverListBase
// Remove an observer from the list if it is in the list.
void RemoveObserver(ObserverType* obs);
- bool HasObserver(ObserverType* observer) const;
+ // Determine whether a particular observer is in the list.
+ bool HasObserver(const ObserverType* observer) const;
void Clear();
@@ -176,7 +177,8 @@ void ObserverListBase<ObserverType>::RemoveObserver(ObserverType* obs) {
}
template <class ObserverType>
-bool ObserverListBase<ObserverType>::HasObserver(ObserverType* observer) const {
+bool ObserverListBase<ObserverType>::HasObserver(
+ const ObserverType* observer) const {
for (size_t i = 0; i < observers_.size(); ++i) {
if (observers_[i] == observer)
return true;
« no previous file with comments | « base/metrics/histogram.h ('k') | base/observer_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698