Chromium Code Reviews| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 204 function(logToServer) { | 204 function(logToServer) { |
| 205 this.logToServer_ = logToServer; | 205 this.logToServer_ = logToServer; |
| 206 this.sendConnectionSetupResultsInternal_(); | 206 this.sendConnectionSetupResultsInternal_(); |
| 207 } | 207 } |
| 208 | 208 |
| 209 remoting.FallbackSignalStrategy.prototype.sendConnectionSetupResultsInternal_ = | 209 remoting.FallbackSignalStrategy.prototype.sendConnectionSetupResultsInternal_ = |
| 210 function() { | 210 function() { |
| 211 for (var i = 0; i < this.connectionSetupResults_.length; ++i) { | 211 for (var i = 0; i < this.connectionSetupResults_.length; ++i) { |
| 212 var result = this.connectionSetupResults_[i]; | 212 var result = this.connectionSetupResults_[i]; |
| 213 this.logToServer_.logSignalStrategyProgress(result.strategyType, | 213 this.logToServer_.logSignalStrategyProgress(result.strategyType, |
| 214 result.progress, | 214 result.progress); |
| 215 result.elapsed); | |
| 216 } | 215 } |
| 217 this.connectionSetupResults_ = []; | 216 this.connectionSetupResults_ = []; |
| 218 }; | 217 }; |
| 219 | 218 |
| 220 /** @return {remoting.SignalStrategy.State} Current state */ | 219 /** @return {remoting.SignalStrategy.State} Current state */ |
| 221 remoting.FallbackSignalStrategy.prototype.getState = function() { | 220 remoting.FallbackSignalStrategy.prototype.getState = function() { |
| 222 return (this.externalState_ === null) | 221 return (this.externalState_ === null) |
| 223 ? remoting.SignalStrategy.State.NOT_CONNECTED | 222 ? remoting.SignalStrategy.State.NOT_CONNECTED |
| 224 : this.externalState_; | 223 : this.externalState_; |
| 225 }; | 224 }; |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 385 * @param {remoting.FallbackSignalStrategy.Progress} progress | 384 * @param {remoting.FallbackSignalStrategy.Progress} progress |
| 386 * @private | 385 * @private |
| 387 */ | 386 */ |
| 388 remoting.FallbackSignalStrategy.prototype.updateProgress_ = function( | 387 remoting.FallbackSignalStrategy.prototype.updateProgress_ = function( |
| 389 strategy, progress) { | 388 strategy, progress) { |
| 390 console.log('FallbackSignalStrategy progress: ' + strategy.getType() + ' ' + | 389 console.log('FallbackSignalStrategy progress: ' + strategy.getType() + ' ' + |
| 391 progress); | 390 progress); |
| 392 this.connectionSetupResults_.push({ | 391 this.connectionSetupResults_.push({ |
| 393 'strategyType': strategy.getType(), | 392 'strategyType': strategy.getType(), |
| 394 'progress': progress, | 393 'progress': progress, |
| 395 'elapsed': new Date().getTime() - this.startTime_ | 394 'elapsed': new Date().getTime() - this.startTime_ |
|
Jamie
2015/02/27 02:24:46
Not that log_to_server is handling elapsed times,
anandc
2015/02/27 21:49:29
Done.
| |
| 396 }); | 395 }); |
| 397 if (this.logToServer_) { | 396 if (this.logToServer_) { |
| 398 this.sendConnectionSetupResultsInternal_(); | 397 this.sendConnectionSetupResultsInternal_(); |
| 399 } | 398 } |
| 400 }; | 399 }; |
| OLD | NEW |