| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_session.h" | 5 #include "remoting/protocol/jingle_session.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 if (state_ == CONNECTING) { | 465 if (state_ == CONNECTING) { |
| 466 error_ = SESSION_REJECTED; | 466 error_ = SESSION_REJECTED; |
| 467 } else { | 467 } else { |
| 468 error_ = OK; | 468 error_ = OK; |
| 469 } | 469 } |
| 470 break; | 470 break; |
| 471 case JingleMessage::DECLINE: | 471 case JingleMessage::DECLINE: |
| 472 error_ = AUTHENTICATION_FAILED; | 472 error_ = AUTHENTICATION_FAILED; |
| 473 break; | 473 break; |
| 474 case JingleMessage::CANCEL: | 474 case JingleMessage::CANCEL: |
| 475 error_ = HOST_IS_DISABLED; | 475 error_ = HOST_OVERLOAD; |
| 476 break; | 476 break; |
| 477 case JingleMessage::GENERAL_ERROR: | 477 case JingleMessage::GENERAL_ERROR: |
| 478 error_ = CHANNEL_CONNECTION_ERROR; | 478 error_ = CHANNEL_CONNECTION_ERROR; |
| 479 break; | 479 break; |
| 480 case JingleMessage::INCOMPATIBLE_PARAMETERS: | 480 case JingleMessage::INCOMPATIBLE_PARAMETERS: |
| 481 error_ = INCOMPATIBLE_PROTOCOL; | 481 error_ = INCOMPATIBLE_PROTOCOL; |
| 482 break; | 482 break; |
| 483 default: | 483 default: |
| 484 error_ = UNKNOWN_ERROR; | 484 error_ = UNKNOWN_ERROR; |
| 485 } | 485 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 case OK: | 542 case OK: |
| 543 reason = JingleMessage::SUCCESS; | 543 reason = JingleMessage::SUCCESS; |
| 544 break; | 544 break; |
| 545 case SESSION_REJECTED: | 545 case SESSION_REJECTED: |
| 546 case AUTHENTICATION_FAILED: | 546 case AUTHENTICATION_FAILED: |
| 547 reason = JingleMessage::DECLINE; | 547 reason = JingleMessage::DECLINE; |
| 548 break; | 548 break; |
| 549 case INCOMPATIBLE_PROTOCOL: | 549 case INCOMPATIBLE_PROTOCOL: |
| 550 reason = JingleMessage::INCOMPATIBLE_PARAMETERS; | 550 reason = JingleMessage::INCOMPATIBLE_PARAMETERS; |
| 551 break; | 551 break; |
| 552 case HOST_IS_DISABLED: | 552 case HOST_OVERLOAD: |
| 553 reason = JingleMessage::CANCEL; | 553 reason = JingleMessage::CANCEL; |
| 554 break; | 554 break; |
| 555 default: | 555 default: |
| 556 reason = JingleMessage::GENERAL_ERROR; | 556 reason = JingleMessage::GENERAL_ERROR; |
| 557 } | 557 } |
| 558 | 558 |
| 559 JingleMessage message(peer_jid_, JingleMessage::SESSION_TERMINATE, | 559 JingleMessage message(peer_jid_, JingleMessage::SESSION_TERMINATE, |
| 560 session_id_); | 560 session_id_); |
| 561 message.reason = reason; | 561 message.reason = reason; |
| 562 SendMessage(message); | 562 SendMessage(message); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 581 DCHECK_NE(state_, FAILED); | 581 DCHECK_NE(state_, FAILED); |
| 582 | 582 |
| 583 state_ = new_state; | 583 state_ = new_state; |
| 584 if (!state_change_callback_.is_null()) | 584 if (!state_change_callback_.is_null()) |
| 585 state_change_callback_.Run(new_state); | 585 state_change_callback_.Run(new_state); |
| 586 } | 586 } |
| 587 } | 587 } |
| 588 | 588 |
| 589 } // namespace protocol | 589 } // namespace protocol |
| 590 } // namespace remoting | 590 } // namespace remoting |
| OLD | NEW |