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

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 2422923002: Reduce usage of FOR_EACH_OBSERVER macro in content/browser (Closed)
Patch Set: skip cases in 2418143004 and 2418373002 Created 4 years, 2 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 | content/browser/appcache/appcache_group.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index ee26b1b3f19c188d4ccf6adfd174d381ee8ba6ec..498c94f27bef6cc5259e517eb0240404a91f1d3f 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -258,9 +258,8 @@ void ContentViewCoreImpl::RemoveObserver(
ContentViewCoreImpl::~ContentViewCoreImpl() {
view_.GetLayer()->RemoveFromParent();
- FOR_EACH_OBSERVER(ContentViewCoreImplObserver,
- observer_list_,
- OnContentViewCoreDestroyed());
+ for (auto& observer : observer_list_)
+ observer.OnContentViewCoreDestroyed();
observer_list_.Clear();
JNIEnv* env = base::android::AttachCurrentThread();
@@ -281,13 +280,11 @@ void ContentViewCoreImpl::UpdateWindowAndroid(
ui::WindowAndroid* window =
reinterpret_cast<ui::WindowAndroid*>(window_android);
window->AddChild(&view_);
- FOR_EACH_OBSERVER(ContentViewCoreImplObserver,
- observer_list_,
- OnAttachedToWindow());
+ for (auto& observer : observer_list_)
+ observer.OnAttachedToWindow();
} else {
- FOR_EACH_OBSERVER(ContentViewCoreImplObserver,
- observer_list_,
- OnDetachedFromWindow());
+ for (auto& observer : observer_list_)
+ observer.OnDetachedFromWindow();
view_.RemoveFromParent();
}
}
« no previous file with comments | « no previous file | content/browser/appcache/appcache_group.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698