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

Unified Diff: ui/events/platform/platform_event_source.cc

Issue 2414863002: Remove usage of base::ObserverList<T>::Iter::GetNext() in //ui. (Closed)
Patch Set: debrace 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 | « ui/compositor/layer_animator.cc ('k') | ui/events/platform/x11/x11_event_source_libevent.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/platform/platform_event_source.cc
diff --git a/ui/events/platform/platform_event_source.cc b/ui/events/platform/platform_event_source.cc
index a33562693abce3b5516a70848e7b9faa77316afa..dfab7fce76648ffdcc00fc592dbd262625eef83c 100644
--- a/ui/events/platform/platform_event_source.cc
+++ b/ui/events/platform/platform_event_source.cc
@@ -75,12 +75,10 @@ uint32_t PlatformEventSource::DispatchEvent(PlatformEvent platform_event) {
if (overridden_dispatcher_)
action = overridden_dispatcher_->DispatchEvent(platform_event);
- if ((action & POST_DISPATCH_PERFORM_DEFAULT) &&
- dispatchers_.might_have_observers()) {
- base::ObserverList<PlatformEventDispatcher>::Iterator iter(&dispatchers_);
- while (PlatformEventDispatcher* dispatcher = iter.GetNext()) {
- if (dispatcher->CanDispatchEvent(platform_event))
- action = dispatcher->DispatchEvent(platform_event);
+ if (action & POST_DISPATCH_PERFORM_DEFAULT) {
+ for (PlatformEventDispatcher& dispatcher : dispatchers_) {
+ if (dispatcher.CanDispatchEvent(platform_event))
+ action = dispatcher.DispatchEvent(platform_event);
if (action & POST_DISPATCH_STOP_PROPAGATION)
break;
}
« no previous file with comments | « ui/compositor/layer_animator.cc ('k') | ui/events/platform/x11/x11_event_source_libevent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698