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

Unified Diff: base/message_pump_aurax11.h

Issue 11593015: MessagePumpAuraX11: Make root_window_dispatchers_ an ObserverList. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years 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 | base/message_pump_aurax11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_pump_aurax11.h
===================================================================
--- base/message_pump_aurax11.h (revision 173799)
+++ base/message_pump_aurax11.h (working copy)
@@ -5,16 +5,16 @@
#ifndef BASE_MESSAGE_PUMP_AURAX11_H
#define BASE_MESSAGE_PUMP_AURAX11_H
+#include <bitset>
+#include <map>
+
#include "base/memory/scoped_ptr.h"
#include "base/message_pump.h"
#include "base/message_pump_glib.h"
#include "base/message_pump_dispatcher.h"
#include "base/message_pump_observer.h"
+#include "base/observer_list.h"
-#include <bitset>
-#include <map>
-#include <vector>
-
// It would be nice to include the X11 headers here so that we use Window
// instead of its typedef of unsigned long, but we can't because everything in
// chrome includes us through base/message_loop.h, and X11's crappy #define
@@ -77,7 +77,6 @@
private:
typedef std::map<unsigned long, MessagePumpDispatcher*> DispatchersMap;
- typedef std::vector<MessagePumpDispatcher*> Dispatchers;
// Initializes the glib event source for X.
void InitXSource();
@@ -106,8 +105,12 @@
scoped_ptr<GPollFD> x_poll_;
DispatchersMap dispatchers_;
- Dispatchers root_window_dispatchers_;
+ // Dispatch calls can cause addition of new dispatchers as we iterate
+ // through them. Use ObserverList to ensure the iterator remains valid across
+ // additions.
+ ObserverList<MessagePumpDispatcher> root_window_dispatchers_;
+
unsigned long x_root_window_;
DISALLOW_COPY_AND_ASSIGN(MessagePumpAuraX11);
« no previous file with comments | « no previous file | base/message_pump_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698