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

Side by Side Diff: trunk/src/base/message_loop/message_pump_aurax11.h

Issue 19737005: Revert 212948 "Made MessagePump a non-thread safe class." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_AURAX11_H 5 #ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_AURAX11_H
6 #define BASE_MESSAGE_LOOP_MESSAGE_PUMP_AURAX11_H 6 #define BASE_MESSAGE_LOOP_MESSAGE_PUMP_AURAX11_H
7 7
8 #include <bitset> 8 #include <bitset>
9 #include <map> 9 #include <map>
10 10
(...skipping 17 matching lines...) Expand all
28 28
29 // This class implements a message-pump for dispatching X events. 29 // This class implements a message-pump for dispatching X events.
30 // 30 //
31 // If there's a current dispatcher given through RunWithDispatcher(), that 31 // If there's a current dispatcher given through RunWithDispatcher(), that
32 // dispatcher receives events. Otherwise, we route to messages to dispatchers 32 // dispatcher receives events. Otherwise, we route to messages to dispatchers
33 // who have subscribed to messages from a specific X11 window. 33 // who have subscribed to messages from a specific X11 window.
34 class BASE_EXPORT MessagePumpAuraX11 : public MessagePumpGlib, 34 class BASE_EXPORT MessagePumpAuraX11 : public MessagePumpGlib,
35 public MessagePumpDispatcher { 35 public MessagePumpDispatcher {
36 public: 36 public:
37 MessagePumpAuraX11(); 37 MessagePumpAuraX11();
38 virtual ~MessagePumpAuraX11();
39 38
40 // Returns default X Display. 39 // Returns default X Display.
41 static Display* GetDefaultXDisplay(); 40 static Display* GetDefaultXDisplay();
42 41
43 // Returns true if the system supports XINPUT2. 42 // Returns true if the system supports XINPUT2.
44 static bool HasXInput2(); 43 static bool HasXInput2();
45 44
46 // Returns the UI message pump. 45 // Returns the UI message pump.
47 static MessagePumpAuraX11* Current(); 46 static MessagePumpAuraX11* Current();
48 47
(...skipping 17 matching lines...) Expand all
66 // xserver that |w| has been mapped; StructureNotifyMask events on |w| are 65 // xserver that |w| has been mapped; StructureNotifyMask events on |w| are
67 // pulled out from the queue and dispatched out of order. 66 // pulled out from the queue and dispatched out of order.
68 // 67 //
69 // For those that know X11, this is really a wrapper around XWindowEvent 68 // For those that know X11, this is really a wrapper around XWindowEvent
70 // which still makes sure the preempted event is dispatched instead of 69 // which still makes sure the preempted event is dispatched instead of
71 // dropped on the floor. This method exists because mapping a window is 70 // dropped on the floor. This method exists because mapping a window is
72 // asynchronous (and we receive an XEvent when mapped), while there are also 71 // asynchronous (and we receive an XEvent when mapped), while there are also
73 // functions which require a mapped window. 72 // functions which require a mapped window.
74 void BlockUntilWindowMapped(unsigned long xid); 73 void BlockUntilWindowMapped(unsigned long xid);
75 74
75 protected:
76 virtual ~MessagePumpAuraX11();
77
76 private: 78 private:
77 typedef std::map<unsigned long, MessagePumpDispatcher*> DispatchersMap; 79 typedef std::map<unsigned long, MessagePumpDispatcher*> DispatchersMap;
78 80
79 // Initializes the glib event source for X. 81 // Initializes the glib event source for X.
80 void InitXSource(); 82 void InitXSource();
81 83
82 // Dispatches the XEvent and returns true if we should exit the current loop 84 // Dispatches the XEvent and returns true if we should exit the current loop
83 // of message processing. 85 // of message processing.
84 bool ProcessXEvent(MessagePumpDispatcher* dispatcher, XEvent* event); 86 bool ProcessXEvent(MessagePumpDispatcher* dispatcher, XEvent* event);
85 87
(...skipping 25 matching lines...) Expand all
111 unsigned long x_root_window_; 113 unsigned long x_root_window_;
112 114
113 DISALLOW_COPY_AND_ASSIGN(MessagePumpAuraX11); 115 DISALLOW_COPY_AND_ASSIGN(MessagePumpAuraX11);
114 }; 116 };
115 117
116 typedef MessagePumpAuraX11 MessagePumpForUI; 118 typedef MessagePumpAuraX11 MessagePumpForUI;
117 119
118 } // namespace base 120 } // namespace base
119 121
120 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_AURAX11_H 122 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_AURAX11_H
OLDNEW
« no previous file with comments | « trunk/src/base/message_loop/message_pump_android.h ('k') | trunk/src/base/message_loop/message_pump_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698