| 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_host.h" | 5 #include "remoting/protocol/connection_to_host.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 DCHECK(message_loop_->BelongsToCurrentThread()); | 160 DCHECK(message_loop_->BelongsToCurrentThread()); |
| 161 DCHECK(event_callback_); | 161 DCHECK(event_callback_); |
| 162 | 162 |
| 163 switch (state) { | 163 switch (state) { |
| 164 case Session::FAILED: | 164 case Session::FAILED: |
| 165 switch (session_->error()) { | 165 switch (session_->error()) { |
| 166 case Session::PEER_IS_OFFLINE: | 166 case Session::PEER_IS_OFFLINE: |
| 167 CloseOnError(HOST_IS_OFFLINE); | 167 CloseOnError(HOST_IS_OFFLINE); |
| 168 break; | 168 break; |
| 169 case Session::SESSION_REJECTED: | 169 case Session::SESSION_REJECTED: |
| 170 case Session::AUTHENTICATION_FAILED: |
| 170 CloseOnError(SESSION_REJECTED); | 171 CloseOnError(SESSION_REJECTED); |
| 171 break; | 172 break; |
| 172 case Session::INCOMPATIBLE_PROTOCOL: | 173 case Session::INCOMPATIBLE_PROTOCOL: |
| 173 CloseOnError(INCOMPATIBLE_PROTOCOL); | 174 CloseOnError(INCOMPATIBLE_PROTOCOL); |
| 174 break; | 175 break; |
| 175 case Session::CHANNEL_CONNECTION_ERROR: | 176 case Session::CHANNEL_CONNECTION_ERROR: |
| 176 CloseOnError(NETWORK_FAILURE); | 177 CloseOnError(NETWORK_FAILURE); |
| 177 break; | 178 break; |
| 178 case Session::OK: | 179 case Session::OK: |
| 179 DLOG(FATAL) << "Error code isn't set"; | 180 DLOG(FATAL) << "Error code isn't set"; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 247 |
| 247 if (state != state_) { | 248 if (state != state_) { |
| 248 state_ = state; | 249 state_ = state; |
| 249 error_ = error; | 250 error_ = error; |
| 250 event_callback_->OnConnectionState(state_, error_); | 251 event_callback_->OnConnectionState(state_, error_); |
| 251 } | 252 } |
| 252 } | 253 } |
| 253 | 254 |
| 254 } // namespace protocol | 255 } // namespace protocol |
| 255 } // namespace remoting | 256 } // namespace remoting |
| OLD | NEW |