OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** @suppress {duplicate} */ | 7 /** @suppress {duplicate} */ |
8 var remoting = remoting || {}; | 8 var remoting = remoting || {}; |
9 | 9 |
10 /** | 10 /** |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 this.connectionSetupResults_ = []; | 217 this.connectionSetupResults_ = []; |
218 }; | 218 }; |
219 | 219 |
220 /** @return {remoting.SignalStrategy.State} Current state */ | 220 /** @return {remoting.SignalStrategy.State} Current state */ |
221 remoting.FallbackSignalStrategy.prototype.getState = function() { | 221 remoting.FallbackSignalStrategy.prototype.getState = function() { |
222 return (this.externalState_ === null) | 222 return (this.externalState_ === null) |
223 ? remoting.SignalStrategy.State.NOT_CONNECTED | 223 ? remoting.SignalStrategy.State.NOT_CONNECTED |
224 : this.externalState_; | 224 : this.externalState_; |
225 }; | 225 }; |
226 | 226 |
227 /** @return {remoting.Error} Error when in FAILED state. */ | 227 /** @return {!remoting.Error} Error when in FAILED state. */ |
228 remoting.FallbackSignalStrategy.prototype.getError = function() { | 228 remoting.FallbackSignalStrategy.prototype.getError = function() { |
229 base.debug.assert(this.state_ == this.State.SECONDARY_FAILED); | 229 base.debug.assert(this.state_ == this.State.SECONDARY_FAILED); |
230 base.debug.assert( | 230 base.debug.assert( |
231 this.secondary_.getState() == remoting.SignalStrategy.State.FAILED); | 231 this.secondary_.getState() == remoting.SignalStrategy.State.FAILED); |
232 return this.secondary_.getError(); | 232 return this.secondary_.getError(); |
233 }; | 233 }; |
234 | 234 |
235 /** @return {string} Current JID when in CONNECTED state. */ | 235 /** @return {string} Current JID when in CONNECTED state. */ |
236 remoting.FallbackSignalStrategy.prototype.getJid = function() { | 236 remoting.FallbackSignalStrategy.prototype.getJid = function() { |
237 return this.getConnectedSignalStrategy_().getJid(); | 237 return this.getConnectedSignalStrategy_().getJid(); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 progress); | 391 progress); |
392 this.connectionSetupResults_.push({ | 392 this.connectionSetupResults_.push({ |
393 'strategyType': strategy.getType(), | 393 'strategyType': strategy.getType(), |
394 'progress': progress, | 394 'progress': progress, |
395 'elapsed': new Date().getTime() - this.startTime_ | 395 'elapsed': new Date().getTime() - this.startTime_ |
396 }); | 396 }); |
397 if (this.logToServer_) { | 397 if (this.logToServer_) { |
398 this.sendConnectionSetupResultsInternal_(); | 398 this.sendConnectionSetupResultsInternal_(); |
399 } | 399 } |
400 }; | 400 }; |
OLD | NEW |