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

Unified Diff: components/arc/instance_holder.h

Issue 2147443005: arc: Use FOR_EACH_OBSERVER in InstanceHolder (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/instance_holder.h
diff --git a/components/arc/instance_holder.h b/components/arc/instance_holder.h
index 6aabeee857198c6b4bc31c66c59d7171c0229322..2d22f759b0b73dc921e0ecdf538cf45a1b3a3252 100644
--- a/components/arc/instance_holder.h
+++ b/components/arc/instance_holder.h
@@ -68,12 +68,7 @@ class InstanceHolder {
ptr_.reset();
raw_ptr_ = nullptr;
version_ = 0;
- if (observer_list_.might_have_observers()) {
- typename base::ObserverList<Observer>::Iterator it(&observer_list_);
- Observer* obs;
- while ((obs = it.GetNext()) != nullptr)
- obs->OnInstanceClosed();
- }
+ FOR_EACH_OBSERVER(Observer, observer_list_, OnInstanceClosed());
}
// Sets the interface pointer to |ptr|, once the version is determined. This
@@ -91,12 +86,7 @@ class InstanceHolder {
void SetInstance(T* raw_ptr, uint32_t raw_version = T::Version_) {
raw_ptr_ = raw_ptr;
version_ = raw_version;
- if (observer_list_.might_have_observers()) {
- typename base::ObserverList<Observer>::Iterator it(&observer_list_);
- Observer* obs;
- while ((obs = it.GetNext()) != nullptr)
- obs->OnInstanceReady();
- }
+ FOR_EACH_OBSERVER(Observer, observer_list_, OnInstanceReady());
}
private:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698