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 | 5 |
6 /** @suppress {duplicate} */ | 6 /** @suppress {duplicate} */ |
7 var remoting = remoting || {}; | 7 var remoting = remoting || {}; |
8 | 8 |
9 (function() { | 9 (function() { |
10 | 10 |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
256 this.statsAccumulator_.add(stats); | 256 this.statsAccumulator_.add(stats); |
257 // Send statistics to the server if they've been accumulating for at least | 257 // Send statistics to the server if they've been accumulating for at least |
258 // 60 seconds. | 258 // 60 seconds. |
259 if (this.statsAccumulator_.getTimeSinceFirstValue() >= | 259 if (this.statsAccumulator_.getTimeSinceFirstValue() >= |
260 remoting.SessionLogger.CONNECTION_STATS_ACCUMULATE_TIME) { | 260 remoting.SessionLogger.CONNECTION_STATS_ACCUMULATE_TIME) { |
261 this.logAccumulatedStatistics_(); | 261 this.logAccumulatedStatistics_(); |
262 } | 262 } |
263 }; | 263 }; |
264 | 264 |
265 /** | 265 /** |
266 * Logs host and client dimensions. | |
267 * | |
268 * @param {{width: number, height: number}} hostSize | |
269 * @param {{width: number, height: number}} clientPluginSize | |
270 * @param {{width: number, height: number}} clientWindowSize | |
271 * @param {boolean} clientFullscreen | |
272 */ | |
273 remoting.SessionLogger.prototype.logScreenResolutions = | |
274 function(hostSize, clientPluginSize, clientWindowSize, clientFullscreen) { | |
Lambros
2016/09/28 21:47:57
clientVideoSize instead of clientPluginSize ?
(her
Jamie
2016/09/28 22:09:29
I went with plugin instead of video here because i
| |
275 this.maybeExpireSessionId_(); | |
276 var entry = this.makeScreenResolutions_(hostSize, clientPluginSize, | |
277 clientWindowSize, clientFullscreen); | |
278 this.log_(entry); | |
279 }; | |
280 | |
281 /** | |
266 * @param {remoting.ChromotingEvent.SessionState} state | 282 * @param {remoting.ChromotingEvent.SessionState} state |
267 * @param {remoting.Error=} opt_error | 283 * @param {remoting.Error=} opt_error |
268 * @return {remoting.ChromotingEvent} | 284 * @return {remoting.ChromotingEvent} |
269 * @private | 285 * @private |
270 */ | 286 */ |
271 remoting.SessionLogger.prototype.makeSessionStateChange_ = | 287 remoting.SessionLogger.prototype.makeSessionStateChange_ = |
272 function(state, opt_error) { | 288 function(state, opt_error) { |
273 var entry = new remoting.ChromotingEvent( | 289 var entry = new remoting.ChromotingEvent( |
274 remoting.ChromotingEvent.Type.SESSION_STATE); | 290 remoting.ChromotingEvent.Type.SESSION_STATE); |
275 | 291 |
276 var ConnectionError = remoting.ChromotingEvent.ConnectionError; | 292 var ConnectionError = remoting.ChromotingEvent.ConnectionError; |
277 | 293 |
278 if (!opt_error) { | 294 if (!opt_error) { |
279 entry.connection_error = ConnectionError.NONE; | 295 entry.connection_error = ConnectionError.NONE; |
280 } else if (opt_error instanceof remoting.Error) { | 296 } else if (opt_error instanceof remoting.Error) { |
281 entry.setError(opt_error); | 297 entry.setError(opt_error); |
282 } else { | 298 } else { |
283 entry.connection_error = ConnectionError.UNKNOWN_ERROR; | 299 entry.connection_error = ConnectionError.UNKNOWN_ERROR; |
284 } | 300 } |
285 | 301 |
286 entry.session_state = state; | 302 entry.session_state = state; |
287 | 303 |
288 this.fillEvent_(entry); | 304 this.fillEvent_(entry); |
289 return entry; | 305 return entry; |
290 }; | 306 }; |
291 | 307 |
292 /** | 308 /** |
309 * @param {{width: number, height: number}} hostSize | |
310 * @param {{width: number, height: number}} clientPluginSize | |
311 * @param {{width: number, height: number}} clientWindowSize | |
312 * @param {boolean} clientFullscreen | |
313 * @return {remoting.ChromotingEvent} | |
314 * @private | |
315 */ | |
316 remoting.SessionLogger.prototype.makeScreenResolutions_ = | |
317 function(hostSize, clientPluginSize, clientWindowSize, clientFullscreen) { | |
318 var entry = new remoting.ChromotingEvent( | |
319 remoting.ChromotingEvent.Type.SCREEN_RESOLUTIONS); | |
320 entry.client_video_size = new remoting.ChromotingEvent.ScreenResolution( | |
321 clientPluginSize.width, clientPluginSize.height); | |
322 entry.client_window_size = new remoting.ChromotingEvent.ScreenResolution( | |
323 clientWindowSize.width, clientWindowSize.height); | |
324 entry.host_all_screens_size = new remoting.ChromotingEvent.ScreenResolution( | |
325 hostSize.width, hostSize.height); | |
326 entry.client_fullscreen = clientFullscreen; | |
327 this.fillEvent_(entry); | |
328 return entry; | |
329 }; | |
330 | |
331 /** | |
293 * @return {remoting.ChromotingEvent} | 332 * @return {remoting.ChromotingEvent} |
294 * @private | 333 * @private |
295 */ | 334 */ |
296 remoting.SessionLogger.prototype.makeSessionIdNew_ = function() { | 335 remoting.SessionLogger.prototype.makeSessionIdNew_ = function() { |
297 var entry = new remoting.ChromotingEvent( | 336 var entry = new remoting.ChromotingEvent( |
298 remoting.ChromotingEvent.Type.SESSION_ID_NEW); | 337 remoting.ChromotingEvent.Type.SESSION_ID_NEW); |
299 this.fillEvent_(entry); | 338 this.fillEvent_(entry); |
300 return entry; | 339 return entry; |
301 }; | 340 }; |
302 | 341 |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
514 } | 553 } |
515 | 554 |
516 // The maximum age of a session ID, in milliseconds. | 555 // The maximum age of a session ID, in milliseconds. |
517 remoting.SessionLogger.MAX_SESSION_ID_AGE = 24 * 60 * 60 * 1000; | 556 remoting.SessionLogger.MAX_SESSION_ID_AGE = 24 * 60 * 60 * 1000; |
518 | 557 |
519 // The time over which to accumulate connection statistics before logging them | 558 // The time over which to accumulate connection statistics before logging them |
520 // to the server, in milliseconds. | 559 // to the server, in milliseconds. |
521 remoting.SessionLogger.CONNECTION_STATS_ACCUMULATE_TIME = 60 * 1000; | 560 remoting.SessionLogger.CONNECTION_STATS_ACCUMULATE_TIME = 60 * 1000; |
522 | 561 |
523 })(); | 562 })(); |
OLD | NEW |