Chromium Code Reviews| Index: base/message_pump_glib.h |
| diff --git a/base/message_pump_glib.h b/base/message_pump_glib.h |
| index 06635de73565a4d4d8e35dcd6ee3726f246cbb20..4e07f663825eaf6ca87b382c07cf438221684d73 100644 |
| --- a/base/message_pump_glib.h |
| +++ b/base/message_pump_glib.h |
| @@ -92,11 +92,27 @@ class MessagePumpForUI : public MessagePump { |
| // Returns the dispatcher for the current run state (|state_->dispatcher|). |
| Dispatcher* GetDispatcher(); |
| - private: |
| // We may make recursive calls to Run, so we save state that needs to be |
| // separate between them in this structure type. |
| - struct RunState; |
| + struct RunState { |
|
rjkroege
2010/11/23 23:38:54
why did you have to move this into the include? It
sadrul
2010/11/24 00:55:21
the |should_quit| needs to be set from inside Mess
|
| + Delegate* delegate; |
| + Dispatcher* dispatcher; |
| + |
| + // Used to flag that the current Run() invocation should return ASAP. |
| + bool should_quit; |
| + |
| + // Used to count how many Run() invocations are on the stack. |
| + int run_depth; |
| + |
| + // This keeps the state of whether the pump got signaled that there was new |
| + // work to be done. Since we eat the message on the wake up pipe as soon as |
| + // we get it, we keep that state here to stay consistent. |
| + bool has_work; |
| + }; |
| + RunState* state_; |
| + |
| + private: |
| // Invoked from EventDispatcher. Notifies all observers we're about to |
| // process an event. |
| void WillProcessEvent(GdkEvent* event); |
| @@ -108,8 +124,6 @@ class MessagePumpForUI : public MessagePump { |
| // Callback prior to gdk dispatching an event. |
| static void EventDispatcher(GdkEvent* event, void* data); |
| - RunState* state_; |
| - |
| // This is a GLib structure that we can add event sources to. We use the |
| // default GLib context, which is the one to which all GTK events are |
| // dispatched. |