Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(736)

Unified Diff: remoting/jingle_glue/jingle_thread.cc

Issue 6003003: Fix crash in JingleThread caused by non-nestable tasks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser/sync
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/jingle_glue/jingle_thread_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « no previous file | remoting/jingle_glue/jingle_thread_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698