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

Side by Side Diff: base/message_loop/message_pump_gtk.h

Issue 19661004: Made MessagePump a non-thread safe class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding a missing header. 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
« no previous file with comments | « base/message_loop/message_pump_glib.cc ('k') | base/message_loop/message_pump_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_GTK_H_ 5 #ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_GTK_H_
6 #define BASE_MESSAGE_LOOP_MESSAGE_PUMP_GTK_H_ 6 #define BASE_MESSAGE_LOOP_MESSAGE_PUMP_GTK_H_
7 7
8 #include "base/message_loop/message_pump_glib.h" 8 #include "base/message_loop/message_pump_glib.h"
9 9
10 typedef union _GdkEvent GdkEvent; 10 typedef union _GdkEvent GdkEvent;
(...skipping 25 matching lines...) Expand all
36 virtual bool Dispatch(GdkEvent* event) = 0; 36 virtual bool Dispatch(GdkEvent* event) = 0;
37 37
38 protected: 38 protected:
39 virtual ~MessagePumpDispatcher() {} 39 virtual ~MessagePumpDispatcher() {}
40 }; 40 };
41 41
42 // This class implements a message-pump for dispatching GTK events. 42 // This class implements a message-pump for dispatching GTK events.
43 class BASE_EXPORT MessagePumpGtk : public MessagePumpGlib { 43 class BASE_EXPORT MessagePumpGtk : public MessagePumpGlib {
44 public: 44 public:
45 MessagePumpGtk(); 45 MessagePumpGtk();
46 virtual ~MessagePumpGtk();
46 47
47 // Dispatch an available GdkEvent. Essentially this allows a subclass to do 48 // Dispatch an available GdkEvent. Essentially this allows a subclass to do
48 // some task before/after calling the default handler (EventDispatcher). 49 // some task before/after calling the default handler (EventDispatcher).
49 void DispatchEvents(GdkEvent* event); 50 void DispatchEvents(GdkEvent* event);
50 51
51 // Returns default X Display. 52 // Returns default X Display.
52 static Display* GetDefaultXDisplay(); 53 static Display* GetDefaultXDisplay();
53 54
54 protected:
55 virtual ~MessagePumpGtk();
56
57 private: 55 private:
58 // Invoked from EventDispatcher. Notifies all observers we're about to 56 // Invoked from EventDispatcher. Notifies all observers we're about to
59 // process an event. 57 // process an event.
60 void WillProcessEvent(GdkEvent* event); 58 void WillProcessEvent(GdkEvent* event);
61 59
62 // Invoked from EventDispatcher. Notifies all observers we processed an 60 // Invoked from EventDispatcher. Notifies all observers we processed an
63 // event. 61 // event.
64 void DidProcessEvent(GdkEvent* event); 62 void DidProcessEvent(GdkEvent* event);
65 63
66 // Callback prior to gdk dispatching an event. 64 // Callback prior to gdk dispatching an event.
67 static void EventDispatcher(GdkEvent* event, void* data); 65 static void EventDispatcher(GdkEvent* event, void* data);
68 66
69 DISALLOW_COPY_AND_ASSIGN(MessagePumpGtk); 67 DISALLOW_COPY_AND_ASSIGN(MessagePumpGtk);
70 }; 68 };
71 69
72 typedef MessagePumpGtk MessagePumpForUI; 70 typedef MessagePumpGtk MessagePumpForUI;
73 71
74 } // namespace base 72 } // namespace base
75 73
76 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_GTK_H_ 74 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_GTK_H_
OLDNEW
« no previous file with comments | « base/message_loop/message_pump_glib.cc ('k') | base/message_loop/message_pump_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698