OLD | NEW |
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 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_PUMP_GLIB_H_ | 5 #ifndef BASE_MESSAGE_PUMP_GLIB_H_ |
6 #define BASE_MESSAGE_PUMP_GLIB_H_ | 6 #define BASE_MESSAGE_PUMP_GLIB_H_ |
7 | 7 |
8 #include <glib.h> | 8 #include <glib.h> |
9 | 9 |
| 10 #include "base/lock.h" |
10 #include "base/message_pump.h" | 11 #include "base/message_pump.h" |
11 #include "base/time.h" | 12 #include "base/time.h" |
12 | 13 |
13 namespace base { | 14 namespace base { |
14 | 15 |
15 // This class implements a MessagePump needed for TYPE_UI MessageLoops on | 16 // This class implements a MessagePump needed for TYPE_UI MessageLoops on |
16 // OS_LINUX platforms using GLib. | 17 // OS_LINUX platforms using GLib. |
17 class MessagePumpForUI : public MessagePump { | 18 class MessagePumpForUI : public MessagePump { |
18 public: | 19 public: |
| 20 // A lock for mutual exclusion with the glib main loop, used for |
| 21 // gconf in ProxyConfigServiceLinux. |
| 22 static Lock glib_main_loop_lock_; |
| 23 |
19 MessagePumpForUI(); | 24 MessagePumpForUI(); |
20 ~MessagePumpForUI(); | 25 ~MessagePumpForUI(); |
21 | 26 |
22 virtual void Run(Delegate* delegate); | 27 virtual void Run(Delegate* delegate); |
23 virtual void Quit(); | 28 virtual void Quit(); |
24 virtual void ScheduleWork(); | 29 virtual void ScheduleWork(); |
25 virtual void ScheduleDelayedWork(const Time& delayed_work_time); | 30 virtual void ScheduleDelayedWork(const Time& delayed_work_time); |
26 | 31 |
27 // Internal methods used for processing the pump callbacks. They are | 32 // Internal methods used for processing the pump callbacks. They are |
28 // public for simplicity but should not be used directly. HandlePrepare | 33 // public for simplicity but should not be used directly. HandlePrepare |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 int wakeup_pipe_read_; | 75 int wakeup_pipe_read_; |
71 int wakeup_pipe_write_; | 76 int wakeup_pipe_write_; |
72 GPollFD wakeup_gpollfd_; | 77 GPollFD wakeup_gpollfd_; |
73 | 78 |
74 DISALLOW_COPY_AND_ASSIGN(MessagePumpForUI); | 79 DISALLOW_COPY_AND_ASSIGN(MessagePumpForUI); |
75 }; | 80 }; |
76 | 81 |
77 } // namespace base | 82 } // namespace base |
78 | 83 |
79 #endif // BASE_MESSAGE_PUMP_GLIB_H_ | 84 #endif // BASE_MESSAGE_PUMP_GLIB_H_ |
OLD | NEW |