| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 | 473 |
| 474 void DataChannel::SetState(DataState state) { | 474 void DataChannel::SetState(DataState state) { |
| 475 if (state_ == state) { | 475 if (state_ == state) { |
| 476 return; | 476 return; |
| 477 } | 477 } |
| 478 | 478 |
| 479 state_ = state; | 479 state_ = state; |
| 480 if (observer_) { | 480 if (observer_) { |
| 481 observer_->OnStateChange(); | 481 observer_->OnStateChange(); |
| 482 } | 482 } |
| 483 if (state_ == kClosed) { | 483 if (state_ == kOpen) { |
| 484 SignalOpened(this); |
| 485 } else if (state_ == kClosed) { |
| 484 SignalClosed(this); | 486 SignalClosed(this); |
| 485 } | 487 } |
| 486 } | 488 } |
| 487 | 489 |
| 488 void DataChannel::DisconnectFromProvider() { | 490 void DataChannel::DisconnectFromProvider() { |
| 489 if (!connected_to_provider_) | 491 if (!connected_to_provider_) |
| 490 return; | 492 return; |
| 491 | 493 |
| 492 provider_->DisconnectDataChannel(this); | 494 provider_->DisconnectDataChannel(this); |
| 493 connected_to_provider_ = false; | 495 connected_to_provider_ = false; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 QueueControlMessage(buffer); | 644 QueueControlMessage(buffer); |
| 643 } else { | 645 } else { |
| 644 LOG(LS_ERROR) << "Closing the DataChannel due to a failure to send" | 646 LOG(LS_ERROR) << "Closing the DataChannel due to a failure to send" |
| 645 << " the CONTROL message, send_result = " << send_result; | 647 << " the CONTROL message, send_result = " << send_result; |
| 646 Close(); | 648 Close(); |
| 647 } | 649 } |
| 648 return retval; | 650 return retval; |
| 649 } | 651 } |
| 650 | 652 |
| 651 } // namespace webrtc | 653 } // namespace webrtc |
| OLD | NEW |