Chromium Code Reviews| 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_SIGNAL_STRATEGY_ELAPSED_TIME_ = | 50 remoting.ServerLogEntry.KEY_ELAPSED_TIME_MS_ = |
| 51 'signal-strategy-elapsed-time'; | 51 'elapsed-time'; |
|
Jamie
2015/02/27 02:24:46
This will now all fit on one line.
anandc
2015/02/27 21:49:29
Done.
| |
| 52 | |
| 53 | |
| 52 | 54 |
| 53 /** | 55 /** |
| 54 * @private | 56 * @private |
| 55 * @param {remoting.ClientSession.State} state | 57 * @param {remoting.ClientSession.State} state |
| 56 * @return {string} | 58 * @return {string} |
| 57 */ | 59 */ |
| 58 remoting.ServerLogEntry.getValueForSessionState_ = function(state) { | 60 remoting.ServerLogEntry.getValueForSessionState_ = function(state) { |
| 59 switch(state) { | 61 switch(state) { |
| 60 case remoting.ClientSession.State.UNKNOWN: | 62 case remoting.ClientSession.State.UNKNOWN: |
| 61 return 'unknown'; | 63 return 'unknown'; |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 350 entry.addModeField(mode); | 352 entry.addModeField(mode); |
| 351 return entry; | 353 return entry; |
| 352 }; | 354 }; |
| 353 | 355 |
| 354 /** | 356 /** |
| 355 * Makes a log entry for a "signal strategy fallback" event. | 357 * Makes a log entry for a "signal strategy fallback" event. |
| 356 * | 358 * |
| 357 * @param {string} sessionId | 359 * @param {string} sessionId |
| 358 * @param {remoting.SignalStrategy.Type} strategyType | 360 * @param {remoting.SignalStrategy.Type} strategyType |
| 359 * @param {remoting.FallbackSignalStrategy.Progress} progress | 361 * @param {remoting.FallbackSignalStrategy.Progress} progress |
| 360 * @param {number} elapsedTimeInMs | |
| 361 * @return {remoting.ServerLogEntry} | 362 * @return {remoting.ServerLogEntry} |
| 362 */ | 363 */ |
| 363 remoting.ServerLogEntry.makeSignalStrategyProgress = | 364 remoting.ServerLogEntry.makeSignalStrategyProgress = |
| 364 function(sessionId, strategyType, progress, elapsedTimeInMs) { | 365 function(sessionId, strategyType, progress) { |
| 365 var entry = new remoting.ServerLogEntry(); | 366 var entry = new remoting.ServerLogEntry(); |
| 366 entry.set_(remoting.ServerLogEntry.KEY_ROLE_, | 367 entry.set_(remoting.ServerLogEntry.KEY_ROLE_, |
| 367 remoting.ServerLogEntry.VALUE_ROLE_CLIENT_); | 368 remoting.ServerLogEntry.VALUE_ROLE_CLIENT_); |
| 368 entry.set_( | 369 entry.set_( |
| 369 remoting.ServerLogEntry.KEY_EVENT_NAME_, | 370 remoting.ServerLogEntry.KEY_EVENT_NAME_, |
| 370 remoting.ServerLogEntry.VALUE_EVENT_NAME_SIGNAL_STRATEGY_PROGRESS_); | 371 remoting.ServerLogEntry.VALUE_EVENT_NAME_SIGNAL_STRATEGY_PROGRESS_); |
| 371 entry.addSessionIdField(sessionId); | 372 entry.addSessionIdField(sessionId); |
| 372 entry.set_(remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_TYPE_, strategyType); | 373 entry.set_(remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_TYPE_, strategyType); |
| 373 entry.set_(remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_PROGRESS_, progress); | 374 entry.set_(remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_PROGRESS_, progress); |
| 374 entry.set_(remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_ELAPSED_TIME_, | |
| 375 String(elapsedTimeInMs)); | |
| 376 | 375 |
| 377 return entry; | 376 return entry; |
| 378 }; | 377 }; |
| 379 | 378 |
| 380 /** | 379 /** |
| 381 * Adds a session ID field to this log entry. | 380 * Adds a session ID field to this log entry. |
| 382 * | 381 * |
| 383 * @param {string} sessionId | 382 * @param {string} sessionId |
| 384 */ | 383 */ |
| 385 remoting.ServerLogEntry.prototype.addSessionIdField = function(sessionId) { | 384 remoting.ServerLogEntry.prototype.addSessionIdField = function(sessionId) { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 460 return { | 459 return { |
| 461 'os_name': remoting.ServerLogEntry.VALUE_OS_NAME_CHROMEOS_, | 460 'os_name': remoting.ServerLogEntry.VALUE_OS_NAME_CHROMEOS_, |
| 462 'os_version': match[2], | 461 'os_version': match[2], |
| 463 'cpu': match[1] | 462 'cpu': match[1] |
| 464 }; | 463 }; |
| 465 } | 464 } |
| 466 return null; | 465 return null; |
| 467 }; | 466 }; |
| 468 | 467 |
| 469 /** | 468 /** |
| 469 * Adds a field to this log entry specifying the elapsed time since the start of | |
| 470 * the session to the current session state. | |
| 471 * @param {number} elapsedTimeInMs | |
| 472 */ | |
| 473 remoting.ServerLogEntry.prototype.addElapsedTimeMs = | |
| 474 function(elapsedTimeInMs) { | |
| 475 this.set_(remoting.ServerLogEntry.KEY_ELAPSED_TIME_MS_, | |
| 476 String(elapsedTimeInMs)); | |
| 477 }; | |
| 478 | |
| 479 | |
| 480 /** | |
| 470 * Adds a field specifying the browser version to this log entry. | 481 * Adds a field specifying the browser version to this log entry. |
| 471 */ | 482 */ |
| 472 remoting.ServerLogEntry.prototype.addChromeVersionField = function() { | 483 remoting.ServerLogEntry.prototype.addChromeVersionField = function() { |
| 473 var version = remoting.getChromeVersion(); | 484 var version = remoting.getChromeVersion(); |
| 474 if (version != null) { | 485 if (version != null) { |
| 475 this.set_(remoting.ServerLogEntry.KEY_BROWSER_VERSION_, version); | 486 this.set_(remoting.ServerLogEntry.KEY_BROWSER_VERSION_, version); |
| 476 } | 487 } |
| 477 }; | 488 }; |
| 478 | 489 |
| 479 /** | 490 /** |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 508 case remoting.DesktopConnectedView.Mode.IT2ME: | 519 case remoting.DesktopConnectedView.Mode.IT2ME: |
| 509 return remoting.ServerLogEntry.VALUE_MODE_IT2ME_; | 520 return remoting.ServerLogEntry.VALUE_MODE_IT2ME_; |
| 510 case remoting.DesktopConnectedView.Mode.ME2ME: | 521 case remoting.DesktopConnectedView.Mode.ME2ME: |
| 511 return remoting.ServerLogEntry.VALUE_MODE_ME2ME_; | 522 return remoting.ServerLogEntry.VALUE_MODE_ME2ME_; |
| 512 case remoting.DesktopConnectedView.Mode.APP_REMOTING: | 523 case remoting.DesktopConnectedView.Mode.APP_REMOTING: |
| 513 return remoting.ServerLogEntry.VALUE_MODE_APP_REMOTING_; | 524 return remoting.ServerLogEntry.VALUE_MODE_APP_REMOTING_; |
| 514 default: | 525 default: |
| 515 return remoting.ServerLogEntry.VALUE_MODE_UNKNOWN_; | 526 return remoting.ServerLogEntry.VALUE_MODE_UNKNOWN_; |
| 516 } | 527 } |
| 517 }; | 528 }; |
| OLD | NEW |