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 * A class of server log entries. | 7 * A class of server log entries. |
8 * | 8 * |
9 * Any changes to the values here need to be coordinated with the host and | 9 * Any changes to the values here need to be coordinated with the host and |
10 * server/log proto code. | 10 * server/log proto code. |
(...skipping 29 matching lines...) Expand all Loading... |
40 /** @private */ | 40 /** @private */ |
41 remoting.ServerLogEntry.KEY_SESSION_STATE_ = 'session-state'; | 41 remoting.ServerLogEntry.KEY_SESSION_STATE_ = 'session-state'; |
42 /** @private */ | 42 /** @private */ |
43 remoting.ServerLogEntry.KEY_CONNECTION_TYPE_ = 'connection-type'; | 43 remoting.ServerLogEntry.KEY_CONNECTION_TYPE_ = 'connection-type'; |
44 /** @private */ | 44 /** @private */ |
45 remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_TYPE_ = 'signal-strategy-type'; | 45 remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_TYPE_ = 'signal-strategy-type'; |
46 /** @private */ | 46 /** @private */ |
47 remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_PROGRESS_ = | 47 remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_PROGRESS_ = |
48 'signal-strategy-progress'; | 48 'signal-strategy-progress'; |
49 /** @private */ | 49 /** @private */ |
50 remoting.ServerLogEntry.KEY_ELAPSED_TIME_MS_ = 'elapsed-time'; | 50 remoting.ServerLogEntry.KEY_SESSION_DURATION_SECONDS_ = 'session-duration'; |
51 | 51 |
52 | 52 |
53 /** | 53 /** |
54 * @private | 54 * @private |
55 * @param {remoting.ClientSession.State} state | 55 * @param {remoting.ClientSession.State} state |
56 * @return {string} | 56 * @return {string} |
57 */ | 57 */ |
58 remoting.ServerLogEntry.getValueForSessionState_ = function(state) { | 58 remoting.ServerLogEntry.getValueForSessionState_ = function(state) { |
59 switch(state) { | 59 switch(state) { |
60 case remoting.ClientSession.State.UNKNOWN: | 60 case remoting.ClientSession.State.UNKNOWN: |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 return { | 444 return { |
445 'os_name': remoting.ServerLogEntry.VALUE_OS_NAME_CHROMEOS_, | 445 'os_name': remoting.ServerLogEntry.VALUE_OS_NAME_CHROMEOS_, |
446 'os_version': match[2], | 446 'os_version': match[2], |
447 'cpu': match[1] | 447 'cpu': match[1] |
448 }; | 448 }; |
449 } | 449 } |
450 return null; | 450 return null; |
451 }; | 451 }; |
452 | 452 |
453 /** | 453 /** |
454 * Adds a field to this log entry specifying the elapsed time since the start of | 454 * Adds a field to this log entry specifying the time in seconds since the start |
455 * the session to the current session state. | 455 * of the session to the current event. |
456 * @param {number} elapsedTimeInMs | 456 * @param {number} sessionDurationInSeconds |
457 */ | 457 */ |
458 remoting.ServerLogEntry.prototype.addElapsedTimeMs = | 458 remoting.ServerLogEntry.prototype.addSessionDuration = |
459 function(elapsedTimeInMs) { | 459 function(sessionDurationInSeconds) { |
460 this.set_(remoting.ServerLogEntry.KEY_ELAPSED_TIME_MS_, | 460 this.set_(remoting.ServerLogEntry.KEY_SESSION_DURATION_SECONDS_, |
461 String(elapsedTimeInMs)); | 461 String(sessionDurationInSeconds)); |
462 }; | 462 }; |
463 | 463 |
464 | 464 |
465 /** | 465 /** |
466 * Adds a field specifying the browser version to this log entry. | 466 * Adds a field specifying the browser version to this log entry. |
467 */ | 467 */ |
468 remoting.ServerLogEntry.prototype.addChromeVersionField = function() { | 468 remoting.ServerLogEntry.prototype.addChromeVersionField = function() { |
469 var version = remoting.getChromeVersion(); | 469 var version = remoting.getChromeVersion(); |
470 if (version != null) { | 470 if (version != null) { |
471 this.set_(remoting.ServerLogEntry.KEY_BROWSER_VERSION_, version); | 471 this.set_(remoting.ServerLogEntry.KEY_BROWSER_VERSION_, version); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 case remoting.DesktopConnectedView.Mode.IT2ME: | 504 case remoting.DesktopConnectedView.Mode.IT2ME: |
505 return remoting.ServerLogEntry.VALUE_MODE_IT2ME_; | 505 return remoting.ServerLogEntry.VALUE_MODE_IT2ME_; |
506 case remoting.DesktopConnectedView.Mode.ME2ME: | 506 case remoting.DesktopConnectedView.Mode.ME2ME: |
507 return remoting.ServerLogEntry.VALUE_MODE_ME2ME_; | 507 return remoting.ServerLogEntry.VALUE_MODE_ME2ME_; |
508 case remoting.DesktopConnectedView.Mode.APP_REMOTING: | 508 case remoting.DesktopConnectedView.Mode.APP_REMOTING: |
509 return remoting.ServerLogEntry.VALUE_MODE_APP_REMOTING_; | 509 return remoting.ServerLogEntry.VALUE_MODE_APP_REMOTING_; |
510 default: | 510 default: |
511 return remoting.ServerLogEntry.VALUE_MODE_UNKNOWN_; | 511 return remoting.ServerLogEntry.VALUE_MODE_UNKNOWN_; |
512 } | 512 } |
513 }; | 513 }; |
OLD | NEW |