| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * Class handling reconnecting the session when it is disconnected due to | 7 * Class handling reconnecting the session when it is disconnected due to |
| 8 * network failure. | 8 * network failure. |
| 9 * | 9 * |
| 10 * The SmartReconnector listens for changes in connection state of | 10 * The SmartReconnector listens for changes in connection state of |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // Therefore, delay the connection by |kReconnectDelay| to allow for the network | 61 // Therefore, delay the connection by |kReconnectDelay| to allow for the network |
| 62 // to connect. | 62 // to connect. |
| 63 remoting.SmartReconnector.kReconnectDelay = 2000; | 63 remoting.SmartReconnector.kReconnectDelay = 2000; |
| 64 | 64 |
| 65 // If the video channel is inactive for 10 seconds reconnect the session. | 65 // If the video channel is inactive for 10 seconds reconnect the session. |
| 66 remoting.SmartReconnector.kConnectionTimeout = 10000; | 66 remoting.SmartReconnector.kConnectionTimeout = 10000; |
| 67 | 67 |
| 68 remoting.SmartReconnector.prototype = { | 68 remoting.SmartReconnector.prototype = { |
| 69 reconnect_: function() { | 69 reconnect_: function() { |
| 70 this.cancelPending_(); | 70 this.cancelPending_(); |
| 71 remoting.disconnect(); | 71 remoting.app.disconnect(); |
| 72 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING); | 72 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING); |
| 73 this.connector_.reconnect(); | 73 this.connector_.reconnect(); |
| 74 }, | 74 }, |
| 75 | 75 |
| 76 reconnectAsync_: function() { | 76 reconnectAsync_: function() { |
| 77 this.cancelPending_(); | 77 this.cancelPending_(); |
| 78 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING); | 78 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING); |
| 79 this.reconnectTimerId_ = window.setTimeout( | 79 this.reconnectTimerId_ = window.setTimeout( |
| 80 this.bound_.reconnect, remoting.SmartReconnector.kReconnectDelay); | 80 this.bound_.reconnect, remoting.SmartReconnector.kReconnectDelay); |
| 81 }, | 81 }, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 dispose: function() { | 125 dispose: function() { |
| 126 this.clientSession_.removeEventListener( | 126 this.clientSession_.removeEventListener( |
| 127 remoting.ClientSession.Events.stateChanged, | 127 remoting.ClientSession.Events.stateChanged, |
| 128 this.bound_.stateChanged); | 128 this.bound_.stateChanged); |
| 129 this.clientSession_.removeEventListener( | 129 this.clientSession_.removeEventListener( |
| 130 remoting.ClientSession.Events.videoChannelStateChanged, | 130 remoting.ClientSession.Events.videoChannelStateChanged, |
| 131 this.bound_.videoChannelStateChanged); | 131 this.bound_.videoChannelStateChanged); |
| 132 } | 132 } |
| 133 }; | 133 }; |
| OLD | NEW |