| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "remoting/jingle_glue/jingle_thread.h" | 5 #include "remoting/jingle_glue/jingle_thread.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "talk/base/ssladapter.h" | 9 #include "talk/base/ssladapter.h" |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 int64 TaskPump::CurrentTime() { | 22 int64 TaskPump::CurrentTime() { |
| 23 return static_cast<int64>(talk_base::Time()); | 23 return static_cast<int64>(talk_base::Time()); |
| 24 } | 24 } |
| 25 | 25 |
| 26 void TaskPump::OnMessage(talk_base::Message* pmsg) { | 26 void TaskPump::OnMessage(talk_base::Message* pmsg) { |
| 27 RunTasks(); | 27 RunTasks(); |
| 28 } | 28 } |
| 29 | 29 |
| 30 JingleThread::JingleThread() | 30 JingleThread::JingleThread() |
| 31 : message_loop_(NULL), | 31 : task_pump_(NULL), |
| 32 task_pump_(NULL), | 32 started_event_(true, false), |
| 33 started_event_(true, false) { } | 33 message_loop_(NULL) { } |
| 34 | 34 |
| 35 JingleThread::~JingleThread() { } | 35 JingleThread::~JingleThread() { } |
| 36 | 36 |
| 37 void JingleThread::Start() { | 37 void JingleThread::Start() { |
| 38 Thread::Start(); | 38 Thread::Start(); |
| 39 started_event_.Wait(); | 39 started_event_.Wait(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 void JingleThread::Run() { | 42 void JingleThread::Run() { |
| 43 LOG(INFO) << "Started Jingle thread."; | 43 LOG(INFO) << "Started Jingle thread."; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 71 | 71 |
| 72 // Schedule next execution 20ms from now. | 72 // Schedule next execution 20ms from now. |
| 73 PostDelayed(20, this, kRunTasksMessageId); | 73 PostDelayed(20, this, kRunTasksMessageId); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void JingleThread::OnMessage(talk_base::Message* msg) { | 76 void JingleThread::OnMessage(talk_base::Message* msg) { |
| 77 PumpAuxiliaryLoops(); | 77 PumpAuxiliaryLoops(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 } // namespace remoting | 80 } // namespace remoting |
| OLD | NEW |