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_gtk.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_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();
47 46
48 // Dispatch an available GdkEvent. Essentially this allows a subclass to do 47 // Dispatch an available GdkEvent. Essentially this allows a subclass to do
49 // some task before/after calling the default handler (EventDispatcher). 48 // some task before/after calling the default handler (EventDispatcher).
50 void DispatchEvents(GdkEvent* event); 49 void DispatchEvents(GdkEvent* event);
51 50
52 // Returns default X Display. 51 // Returns default X Display.
53 static Display* GetDefaultXDisplay(); 52 static Display* GetDefaultXDisplay();
54 53
54 protected:
55 virtual ~MessagePumpGtk();
56
55 private: 57 private:
56 // Invoked from EventDispatcher. Notifies all observers we're about to 58 // Invoked from EventDispatcher. Notifies all observers we're about to
57 // process an event. 59 // process an event.
58 void WillProcessEvent(GdkEvent* event); 60 void WillProcessEvent(GdkEvent* event);
59 61
60 // Invoked from EventDispatcher. Notifies all observers we processed an 62 // Invoked from EventDispatcher. Notifies all observers we processed an
61 // event. 63 // event.
62 void DidProcessEvent(GdkEvent* event); 64 void DidProcessEvent(GdkEvent* event);
63 65
64 // Callback prior to gdk dispatching an event. 66 // Callback prior to gdk dispatching an event.
65 static void EventDispatcher(GdkEvent* event, void* data); 67 static void EventDispatcher(GdkEvent* event, void* data);
66 68
67 DISALLOW_COPY_AND_ASSIGN(MessagePumpGtk); 69 DISALLOW_COPY_AND_ASSIGN(MessagePumpGtk);
68 }; 70 };
69 71
70 typedef MessagePumpGtk MessagePumpForUI; 72 typedef MessagePumpGtk MessagePumpForUI;
71 73
72 } // namespace base 74 } // namespace base
73 75
74 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_GTK_H_ 76 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_GTK_H_
OLDNEW
« no previous file with comments | « trunk/src/base/message_loop/message_pump_glib.cc ('k') | trunk/src/base/message_loop/message_pump_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698