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/protocol/jingle_connection_to_host.h" | 5 #include "remoting/protocol/jingle_connection_to_host.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "remoting/base/constants.h" | 9 #include "remoting/base/constants.h" |
10 #include "remoting/jingle_glue/jingle_thread.h" | 10 #include "remoting/jingle_glue/jingle_thread.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 50 } |
51 | 51 |
52 void JingleConnectionToHost::Disconnect() { | 52 void JingleConnectionToHost::Disconnect() { |
53 if (MessageLoop::current() != message_loop()) { | 53 if (MessageLoop::current() != message_loop()) { |
54 message_loop()->PostTask( | 54 message_loop()->PostTask( |
55 FROM_HERE, NewRunnableMethod(this, | 55 FROM_HERE, NewRunnableMethod(this, |
56 &JingleConnectionToHost::Disconnect)); | 56 &JingleConnectionToHost::Disconnect)); |
57 return; | 57 return; |
58 } | 58 } |
59 | 59 |
60 control_reader_.Close(); | |
61 video_reader_->Close(); | |
62 | |
63 if (session_) { | 60 if (session_) { |
64 session_->Close( | 61 session_->Close( |
65 NewRunnableMethod(this, &JingleConnectionToHost::OnDisconnected)); | 62 NewRunnableMethod(this, &JingleConnectionToHost::OnDisconnected)); |
66 } else { | 63 } else { |
67 OnDisconnected(); | 64 OnDisconnected(); |
68 } | 65 } |
69 } | 66 } |
70 | 67 |
71 void JingleConnectionToHost::InitSession() { | 68 void JingleConnectionToHost::InitSession() { |
72 DCHECK_EQ(message_loop(), MessageLoop::current()); | 69 DCHECK_EQ(message_loop(), MessageLoop::current()); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 break; | 173 break; |
177 } | 174 } |
178 } | 175 } |
179 | 176 |
180 MessageLoop* JingleConnectionToHost::message_loop() { | 177 MessageLoop* JingleConnectionToHost::message_loop() { |
181 return thread_->message_loop(); | 178 return thread_->message_loop(); |
182 } | 179 } |
183 | 180 |
184 } // namespace protocol | 181 } // namespace protocol |
185 } // namespace remoting | 182 } // namespace remoting |
OLD | NEW |