Chromium Code Reviews| Index: remoting/jingle_glue/jingle_thread.cc |
| diff --git a/remoting/jingle_glue/jingle_thread.cc b/remoting/jingle_glue/jingle_thread.cc |
| index 25f646a1510cf9c807475af90f74eccc545085f1..7c3f1c05b51e1aa1dcdff8ee8441140756b0d2a0 100644 |
| --- a/remoting/jingle_glue/jingle_thread.cc |
| +++ b/remoting/jingle_glue/jingle_thread.cc |
| @@ -42,12 +42,6 @@ class JingleThread::JingleMessagePump : public base::MessagePump, |
| // TODO(sergeyu): Remove it when JingleThread moved on Chromium's |
| // base::Thread. |
| base::MessagePump::Delegate* delegate = thread_->message_loop(); |
| - // Loop until we run out of work. |
| - while (true) { |
| - if (!delegate->DoWork()) |
| - break; |
| - } |
| - |
| // Process all pending tasks. |
| while (true) { |
| if (delegate->DoWork()) |
| @@ -61,7 +55,6 @@ class JingleThread::JingleMessagePump : public base::MessagePump, |
| } |
| private: |
| - |
| void ScheduleNextDelayedTask() { |
| DCHECK_EQ(thread_->message_loop(), MessageLoop::current()); |
| @@ -83,9 +76,16 @@ class JingleThread::JingleMessagePump : public base::MessagePump, |
| class JingleThread::JingleMessageLoop : public MessageLoop { |
| public: |
| JingleMessageLoop(JingleThread* thread) |
| - : MessageLoop(MessageLoop::TYPE_IO) { |
| + : MessageLoop(MessageLoop::TYPE_IO), |
| + ALLOW_THIS_IN_INITIALIZER_LIST(jingle_message_loop_state_(this)) { |
|
awong
2010/12/23 01:16:44
I'd actually throw this out of the constructor. T
Sergey Ulanov
2010/12/23 01:22:50
Yes. Good catch.
|
| pump_ = new JingleMessagePump(thread); |
| } |
| + |
| + private: |
| + // AutoRunState sets |state_| for this message loop. It needs to be |
| + // created here because we never call Run() or RunAllPending() for |
| + // the thread. |
| + AutoRunState jingle_message_loop_state_; |
| }; |
| TaskPump::TaskPump() { |