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

Side by Side Diff: ui/events/platform/x11/x11_event_source_libevent.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/events/platform/x11/x11_event_source_libevent.h" 5 #include "ui/events/platform/x11/x11_event_source_libevent.h"
6 6
7 #include <X11/Xlib.h> 7 #include <X11/Xlib.h>
8 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 return; 172 return;
173 173
174 int fd = ConnectionNumber(event_source_.display()); 174 int fd = ConnectionNumber(event_source_.display());
175 base::MessageLoopForUI::current()->WatchFileDescriptor( 175 base::MessageLoopForUI::current()->WatchFileDescriptor(
176 fd, true, base::MessagePumpLibevent::WATCH_READ, &watcher_controller_, 176 fd, true, base::MessagePumpLibevent::WATCH_READ, &watcher_controller_,
177 this); 177 this);
178 initialized_ = true; 178 initialized_ = true;
179 } 179 }
180 180
181 void X11EventSourceLibevent::DispatchXEventToXEventDispatchers(XEvent* xevent) { 181 void X11EventSourceLibevent::DispatchXEventToXEventDispatchers(XEvent* xevent) {
182 if (dispatchers_xevent_.might_have_observers()) { 182 for (XEventDispatcher& dispatcher : dispatchers_xevent_) {
183 base::ObserverList<XEventDispatcher>::Iterator iter(&dispatchers_xevent_); 183 if (dispatcher.DispatchXEvent(xevent))
184 while (XEventDispatcher* dispatcher = iter.GetNext()) { 184 break;
185 if (dispatcher->DispatchXEvent(xevent))
186 break;
187 }
188 } 185 }
189 } 186 }
190 187
191 void X11EventSourceLibevent::StopCurrentEventStream() { 188 void X11EventSourceLibevent::StopCurrentEventStream() {
192 event_source_.StopCurrentEventStream(); 189 event_source_.StopCurrentEventStream();
193 } 190 }
194 191
195 void X11EventSourceLibevent::OnDispatcherListChanged() { 192 void X11EventSourceLibevent::OnDispatcherListChanged() {
196 AddEventWatcher(); 193 AddEventWatcher();
197 event_source_.OnDispatcherListChanged(); 194 event_source_.OnDispatcherListChanged();
198 } 195 }
199 196
200 void X11EventSourceLibevent::OnFileCanReadWithoutBlocking(int fd) { 197 void X11EventSourceLibevent::OnFileCanReadWithoutBlocking(int fd) {
201 event_source_.DispatchXEvents(); 198 event_source_.DispatchXEvents();
202 } 199 }
203 200
204 void X11EventSourceLibevent::OnFileCanWriteWithoutBlocking(int fd) { 201 void X11EventSourceLibevent::OnFileCanWriteWithoutBlocking(int fd) {
205 NOTREACHED(); 202 NOTREACHED();
206 } 203 }
207 204
208 } // namespace ui 205 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/platform/platform_event_source.cc ('k') | ui/views/mus/pointer_watcher_event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698