| 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 #ifndef REMOTING_JINGLE_GLUE_JINGLE_THREAD_H_ | 5 #ifndef REMOTING_JINGLE_GLUE_JINGLE_THREAD_H_ |
| 6 #define REMOTING_JINGLE_GLUE_JINGLE_THREAD_H_ | 6 #define REMOTING_JINGLE_GLUE_JINGLE_THREAD_H_ |
| 7 | 7 |
| 8 #include "base/gtest_prod_util.h" |
| 8 #include "base/tracked_objects.h" | 9 #include "base/tracked_objects.h" |
| 9 #include "base/waitable_event.h" | 10 #include "base/waitable_event.h" |
| 10 #include "third_party/libjingle/source/talk/base/messagequeue.h" | 11 #include "third_party/libjingle/source/talk/base/messagequeue.h" |
| 11 #include "third_party/libjingle/source/talk/base/taskrunner.h" | 12 #include "third_party/libjingle/source/talk/base/taskrunner.h" |
| 12 #include "third_party/libjingle/source/talk/base/thread.h" | 13 #include "third_party/libjingle/source/talk/base/thread.h" |
| 13 | 14 |
| 14 class MessageLoop; | 15 class MessageLoop; |
| 15 | 16 |
| 16 namespace buzz { | 17 namespace buzz { |
| 17 class XmppClient; | 18 class XmppClient; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 47 | 48 |
| 48 // Returns Chromiums message loop for this thread. | 49 // Returns Chromiums message loop for this thread. |
| 49 // TODO(sergeyu): remove this method when we use base::Thread instead of | 50 // TODO(sergeyu): remove this method when we use base::Thread instead of |
| 50 // talk_base::Thread | 51 // talk_base::Thread |
| 51 MessageLoop* message_loop() { return message_loop_; } | 52 MessageLoop* message_loop() { return message_loop_; } |
| 52 | 53 |
| 53 // Returns task pump if the thread is running, otherwise NULL is returned. | 54 // Returns task pump if the thread is running, otherwise NULL is returned. |
| 54 TaskPump* task_pump() { return task_pump_; } | 55 TaskPump* task_pump() { return task_pump_; } |
| 55 | 56 |
| 56 private: | 57 private: |
| 58 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, DoSendStanza); |
| 59 |
| 57 virtual void OnMessage(talk_base::Message* msg); | 60 virtual void OnMessage(talk_base::Message* msg); |
| 58 | 61 |
| 59 void PumpAuxiliaryLoops(); | 62 void PumpAuxiliaryLoops(); |
| 60 | 63 |
| 61 TaskPump* task_pump_; | 64 TaskPump* task_pump_; |
| 62 base::WaitableEvent started_event_; | 65 base::WaitableEvent started_event_; |
| 63 MessageLoop* message_loop_; | 66 MessageLoop* message_loop_; |
| 64 | 67 |
| 65 DISALLOW_COPY_AND_ASSIGN(JingleThread); | 68 DISALLOW_COPY_AND_ASSIGN(JingleThread); |
| 66 }; | 69 }; |
| 67 | 70 |
| 68 } // namespace remoting | 71 } // namespace remoting |
| 69 | 72 |
| 70 #endif // REMOTING_JINGLE_GLUE_JINGLE_THREAD_H_ | 73 #endif // REMOTING_JINGLE_GLUE_JINGLE_THREAD_H_ |
| OLD | NEW |