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 /** | 5 /** |
6 * @fileoverview | 6 * @fileoverview |
7 * Class handling creation and teardown of a remoting client session. | 7 * Class handling creation and teardown of a remoting client session. |
8 * | 8 * |
9 * The ClientSession class controls lifetime of the client plugin | 9 * The ClientSession class controls lifetime of the client plugin |
10 * object and provides the plugin with the functionality it needs to | 10 * object and provides the plugin with the functionality it needs to |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
195 return remoting.ClientSession.ConnectionError.UNKNOWN; | 195 return remoting.ClientSession.ConnectionError.UNKNOWN; |
196 } | 196 } |
197 return remoting.ClientSession.ConnectionError[error]; | 197 return remoting.ClientSession.ConnectionError[error]; |
198 } | 198 } |
199 | 199 |
200 /** | 200 /** |
201 * Type used for performance statistics collected by the plugin. | 201 * Type used for performance statistics collected by the plugin. |
202 * @constructor | 202 * @constructor |
203 */ | 203 */ |
204 remoting.ClientSession.PerfStats = function() {}; | 204 remoting.ClientSession.PerfStats = function() {}; |
205 /** @type {number} */ | 205 /** @type {!number} */ |
Jamie
2016/05/23 18:18:27
Number is not a nullable type, so you don't need t
Yuwei
2016/05/23 18:25:23
Done.
| |
206 remoting.ClientSession.PerfStats.prototype.videoBandwidth; | 206 remoting.ClientSession.PerfStats.prototype.videoBandwidth = 0; |
207 /** @type {number} */ | 207 /** @type {!number} */ |
208 remoting.ClientSession.PerfStats.prototype.videoFrameRate; | 208 remoting.ClientSession.PerfStats.prototype.videoFrameRate = 0; |
209 /** @type {number} */ | 209 /** @type {!number} */ |
210 remoting.ClientSession.PerfStats.prototype.captureLatency; | 210 remoting.ClientSession.PerfStats.prototype.captureLatency = 0; |
211 /** @type {number} */ | 211 /** @type {!number} */ |
212 remoting.ClientSession.PerfStats.prototype.maxCaptureLatency; | 212 remoting.ClientSession.PerfStats.prototype.maxCaptureLatency = 0; |
213 /** @type {number} */ | 213 /** @type {!number} */ |
214 remoting.ClientSession.PerfStats.prototype.encodeLatency; | 214 remoting.ClientSession.PerfStats.prototype.encodeLatency = 0; |
215 /** @type {number} */ | 215 /** @type {!number} */ |
216 remoting.ClientSession.PerfStats.prototype.maxEncodeLatency; | 216 remoting.ClientSession.PerfStats.prototype.maxEncodeLatency = 0; |
217 /** @type {number} */ | 217 /** @type {!number} */ |
218 remoting.ClientSession.PerfStats.prototype.decodeLatency; | 218 remoting.ClientSession.PerfStats.prototype.decodeLatency = 0; |
219 /** @type {number} */ | 219 /** @type {!number} */ |
220 remoting.ClientSession.PerfStats.prototype.maxDecodeLatency; | 220 remoting.ClientSession.PerfStats.prototype.maxDecodeLatency = 0; |
221 /** @type {number} */ | 221 /** @type {!number} */ |
222 remoting.ClientSession.PerfStats.prototype.renderLatency; | 222 remoting.ClientSession.PerfStats.prototype.renderLatency = 0; |
223 /** @type {number} */ | 223 /** @type {!number} */ |
224 remoting.ClientSession.PerfStats.prototype.maxRenderLatency; | 224 remoting.ClientSession.PerfStats.prototype.maxRenderLatency = 0; |
225 /** @type {number} */ | 225 /** @type {!number} */ |
226 remoting.ClientSession.PerfStats.prototype.roundtripLatency; | 226 remoting.ClientSession.PerfStats.prototype.roundtripLatency = 0; |
227 /** @type {number} */ | 227 /** @type {!number} */ |
228 remoting.ClientSession.PerfStats.prototype.maxRoundtripLatency; | 228 remoting.ClientSession.PerfStats.prototype.maxRoundtripLatency = 0; |
229 | 229 |
230 // Keys for connection statistics. | 230 // Keys for connection statistics. |
231 remoting.ClientSession.STATS_KEY_VIDEO_BANDWIDTH = 'videoBandwidth'; | 231 remoting.ClientSession.STATS_KEY_VIDEO_BANDWIDTH = 'videoBandwidth'; |
232 remoting.ClientSession.STATS_KEY_VIDEO_FRAME_RATE = 'videoFrameRate'; | 232 remoting.ClientSession.STATS_KEY_VIDEO_FRAME_RATE = 'videoFrameRate'; |
233 remoting.ClientSession.STATS_KEY_CAPTURE_LATENCY = 'captureLatency'; | 233 remoting.ClientSession.STATS_KEY_CAPTURE_LATENCY = 'captureLatency'; |
234 remoting.ClientSession.STATS_KEY_ENCODE_LATENCY = 'encodeLatency'; | 234 remoting.ClientSession.STATS_KEY_ENCODE_LATENCY = 'encodeLatency'; |
235 remoting.ClientSession.STATS_KEY_DECODE_LATENCY = 'decodeLatency'; | 235 remoting.ClientSession.STATS_KEY_DECODE_LATENCY = 'decodeLatency'; |
236 remoting.ClientSession.STATS_KEY_RENDER_LATENCY = 'renderLatency'; | 236 remoting.ClientSession.STATS_KEY_RENDER_LATENCY = 'renderLatency'; |
237 remoting.ClientSession.STATS_KEY_ROUNDTRIP_LATENCY = 'roundtripLatency'; | 237 remoting.ClientSession.STATS_KEY_ROUNDTRIP_LATENCY = 'roundtripLatency'; |
238 | 238 |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
713 } else if (previous == State.CONNECTED && current == State.FAILED) { | 713 } else if (previous == State.CONNECTED && current == State.FAILED) { |
714 return State.CONNECTION_DROPPED; | 714 return State.CONNECTION_DROPPED; |
715 } | 715 } |
716 return current; | 716 return current; |
717 }; | 717 }; |
718 | 718 |
719 /** @private */ | 719 /** @private */ |
720 remoting.ClientSession.prototype.reportStatistics = function() { | 720 remoting.ClientSession.prototype.reportStatistics = function() { |
721 this.logger_.logStatistics(this.plugin_.getPerfStats()); | 721 this.logger_.logStatistics(this.plugin_.getPerfStats()); |
722 }; | 722 }; |
OLD | NEW |