| Index: base/message_loop.cc
|
| ===================================================================
|
| --- base/message_loop.cc (revision 22100)
|
| +++ base/message_loop.cc (working copy)
|
| @@ -188,9 +188,10 @@
|
|
|
| StartHistogrammer();
|
|
|
| -#if defined(OS_WIN)
|
| - if (state_->dispatcher) {
|
| - pump_win()->RunWithDispatcher(this, state_->dispatcher);
|
| +#if defined(OS_WIN) || defined(OS_LINUX)
|
| + if (state_->dispatcher && type() == TYPE_UI) {
|
| + static_cast<base::MessagePumpForUI*>(pump_.get())->
|
| + RunWithDispatcher(this, state_->dispatcher);
|
| return;
|
| }
|
| #endif
|
| @@ -480,7 +481,7 @@
|
|
|
| // Initialize the other fields:
|
| quit_received = false;
|
| -#if defined(OS_WIN)
|
| +#if defined(OS_WIN) || defined(OS_LINUX)
|
| dispatcher = NULL;
|
| #endif
|
| }
|
| @@ -570,8 +571,20 @@
|
| //------------------------------------------------------------------------------
|
| // MessageLoopForUI
|
|
|
| -#if defined(OS_LINUX) || defined(OS_WIN)
|
| +#if defined(OS_WIN)
|
| +void MessageLoopForUI::WillProcessMessage(const MSG& message) {
|
| + pump_win()->WillProcessMessage(message);
|
| +}
|
| +void MessageLoopForUI::DidProcessMessage(const MSG& message) {
|
| + pump_win()->DidProcessMessage(message);
|
| +}
|
| +void MessageLoopForUI::PumpOutPendingPaintMessages() {
|
| + pump_ui()->PumpOutPendingPaintMessages();
|
| +}
|
|
|
| +#endif // defined(OS_WIN)
|
| +
|
| +#if defined(OS_LINUX) || defined(OS_WIN)
|
| void MessageLoopForUI::AddObserver(Observer* observer) {
|
| pump_ui()->AddObserver(observer);
|
| }
|
| @@ -580,28 +593,13 @@
|
| pump_ui()->RemoveObserver(observer);
|
| }
|
|
|
| -#endif
|
| -
|
| -#if defined(OS_WIN)
|
| -
|
| void MessageLoopForUI::Run(Dispatcher* dispatcher) {
|
| AutoRunState save_state(this);
|
| state_->dispatcher = dispatcher;
|
| RunHandler();
|
| }
|
| +#endif // defined(OS_LINUX) || defined(OS_WIN)
|
|
|
| -void MessageLoopForUI::WillProcessMessage(const MSG& message) {
|
| - pump_win()->WillProcessMessage(message);
|
| -}
|
| -void MessageLoopForUI::DidProcessMessage(const MSG& message) {
|
| - pump_win()->DidProcessMessage(message);
|
| -}
|
| -void MessageLoopForUI::PumpOutPendingPaintMessages() {
|
| - pump_ui()->PumpOutPendingPaintMessages();
|
| -}
|
| -
|
| -#endif // defined(OS_WIN)
|
| -
|
| //------------------------------------------------------------------------------
|
| // MessageLoopForIO
|
|
|
|
|