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/message_pump.h" | 10 #include "base/message_pump.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
84 // with our state. When ScheduleWork is called, we write into the pipe which | 84 // with our state. When ScheduleWork is called, we write into the pipe which |
85 // ensures poll will not sleep, since we use the read end as an event source. | 85 // ensures poll will not sleep, since we use the read end as an event source. |
86 // When we find data pending on the pipe, we clear it out and know we have | 86 // When we find data pending on the pipe, we clear it out and know we have |
87 // been given new work. | 87 // been given new work. |
88 int write_fd_work_scheduled_; | 88 int write_fd_work_scheduled_; |
89 int read_fd_work_scheduled_; | 89 int read_fd_work_scheduled_; |
90 | 90 |
91 // The work source. It is shared by all calls to Run and destroyed when | 91 // The work source. It is shared by all calls to Run and destroyed when |
92 // the message pump is destroyed. | 92 // the message pump is destroyed. |
93 GSource* work_source_; | 93 GSource* work_source_; |
94 // The GLib poll structure needs to be owned and freed by us. | |
95 GPollFD* work_source_poll_info_; | |
Evan Martin
2008/11/04 21:25:58
could it be a scoped_ptr?
not sure that "info" add
| |
94 | 96 |
95 DISALLOW_COPY_AND_ASSIGN(MessagePumpForUI); | 97 DISALLOW_COPY_AND_ASSIGN(MessagePumpForUI); |
96 }; | 98 }; |
97 | 99 |
98 } // namespace base | 100 } // namespace base |
99 | 101 |
100 #endif // BASE_MESSAGE_PUMP_GLIB_H_ | 102 #endif // BASE_MESSAGE_PUMP_GLIB_H_ |
OLD | NEW |