| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/connection_to_client.h" | 5 #include "remoting/protocol/connection_to_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
| 10 #include "google/protobuf/message.h" | 10 #include "google/protobuf/message.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 150 |
| 151 if (control_dispatcher_.get() && control_dispatcher_->is_connected() && | 151 if (control_dispatcher_.get() && control_dispatcher_->is_connected() && |
| 152 event_dispatcher_.get() && event_dispatcher_->is_connected() && | 152 event_dispatcher_.get() && event_dispatcher_->is_connected() && |
| 153 video_writer_.get() && video_writer_->is_connected()) { | 153 video_writer_.get() && video_writer_->is_connected()) { |
| 154 handler_->OnConnectionOpened(this); | 154 handler_->OnConnectionOpened(this); |
| 155 } | 155 } |
| 156 } | 156 } |
| 157 | 157 |
| 158 void ConnectionToClient::CloseOnError() { | 158 void ConnectionToClient::CloseOnError() { |
| 159 CloseChannels(); | 159 CloseChannels(); |
| 160 handler_->OnConnectionFailed(this); | 160 handler_->OnConnectionFailed(this, session_->error()); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void ConnectionToClient::CloseChannels() { | 163 void ConnectionToClient::CloseChannels() { |
| 164 control_dispatcher_.reset(); | 164 control_dispatcher_.reset(); |
| 165 event_dispatcher_.reset(); | 165 event_dispatcher_.reset(); |
| 166 video_writer_.reset(); | 166 video_writer_.reset(); |
| 167 } | 167 } |
| 168 | 168 |
| 169 } // namespace protocol | 169 } // namespace protocol |
| 170 } // namespace remoting | 170 } // namespace remoting |
| OLD | NEW |