| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 /** @private */ | 152 /** @private */ |
| 153 remoting.ServerLogEntry.KEY_CPU_ = 'cpu'; | 153 remoting.ServerLogEntry.KEY_CPU_ = 'cpu'; |
| 154 | 154 |
| 155 /** @private */ | 155 /** @private */ |
| 156 remoting.ServerLogEntry.KEY_BROWSER_VERSION_ = 'browser-version'; | 156 remoting.ServerLogEntry.KEY_BROWSER_VERSION_ = 'browser-version'; |
| 157 | 157 |
| 158 /** @private */ | 158 /** @private */ |
| 159 remoting.ServerLogEntry.KEY_WEBAPP_VERSION_ = 'webapp-version'; | 159 remoting.ServerLogEntry.KEY_WEBAPP_VERSION_ = 'webapp-version'; |
| 160 | 160 |
| 161 /** @private */ | 161 /** @private */ |
| 162 remoting.ServerLogEntry.KEY_HOST_VERSION_ = 'host-version'; |
| 163 |
| 164 /** @private */ |
| 162 remoting.ServerLogEntry.VALUE_EVENT_NAME_SESSION_ID_OLD_ = 'session-id-old'; | 165 remoting.ServerLogEntry.VALUE_EVENT_NAME_SESSION_ID_OLD_ = 'session-id-old'; |
| 163 | 166 |
| 164 /** @private */ | 167 /** @private */ |
| 165 remoting.ServerLogEntry.VALUE_EVENT_NAME_SESSION_ID_NEW_ = 'session-id-new'; | 168 remoting.ServerLogEntry.VALUE_EVENT_NAME_SESSION_ID_NEW_ = 'session-id-new'; |
| 166 | 169 |
| 167 /** @private */ | 170 /** @private */ |
| 168 remoting.ServerLogEntry.KEY_MODE_ = 'mode'; | 171 remoting.ServerLogEntry.KEY_MODE_ = 'mode'; |
| 169 /** @private */ | 172 /** @private */ |
| 170 remoting.ServerLogEntry.VALUE_MODE_IT2ME_ = 'it2me'; | 173 remoting.ServerLogEntry.VALUE_MODE_IT2ME_ = 'it2me'; |
| 171 /** @private */ | 174 /** @private */ |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 * | 363 * |
| 361 * @param {string} sessionId | 364 * @param {string} sessionId |
| 362 */ | 365 */ |
| 363 remoting.ServerLogEntry.prototype.addSessionIdField = function(sessionId) { | 366 remoting.ServerLogEntry.prototype.addSessionIdField = function(sessionId) { |
| 364 this.set_(remoting.ServerLogEntry.KEY_SESSION_ID_, sessionId); | 367 this.set_(remoting.ServerLogEntry.KEY_SESSION_ID_, sessionId); |
| 365 } | 368 } |
| 366 | 369 |
| 367 /** | 370 /** |
| 368 * Adds fields describing the host to this log entry. | 371 * Adds fields describing the host to this log entry. |
| 369 */ | 372 */ |
| 370 remoting.ServerLogEntry.prototype.addHostFields = function() { | 373 remoting.ServerLogEntry.prototype.addClientOSFields = function() { |
| 371 var host = remoting.ServerLogEntry.getHostData_(); | 374 var host = remoting.ServerLogEntry.getHostData_(); |
| 372 if (host) { | 375 if (host) { |
| 373 if (host.os_name.length > 0) { | 376 if (host.os_name.length > 0) { |
| 374 this.set_(remoting.ServerLogEntry.KEY_OS_NAME_, host.os_name); | 377 this.set_(remoting.ServerLogEntry.KEY_OS_NAME_, host.os_name); |
| 375 } | 378 } |
| 376 if (host.os_version.length > 0) { | 379 if (host.os_version.length > 0) { |
| 377 this.set_(remoting.ServerLogEntry.KEY_OS_VERSION_, host.os_version); | 380 this.set_(remoting.ServerLogEntry.KEY_OS_VERSION_, host.os_version); |
| 378 } | 381 } |
| 379 if (host.cpu.length > 0) { | 382 if (host.cpu.length > 0) { |
| 380 this.set_(remoting.ServerLogEntry.KEY_CPU_, host.cpu); | 383 this.set_(remoting.ServerLogEntry.KEY_CPU_, host.cpu); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 * Adds a field specifying the webapp version to this log entry. | 473 * Adds a field specifying the webapp version to this log entry. |
| 471 */ | 474 */ |
| 472 remoting.ServerLogEntry.prototype.addWebappVersionField = function() { | 475 remoting.ServerLogEntry.prototype.addWebappVersionField = function() { |
| 473 var manifest = chrome.runtime.getManifest(); | 476 var manifest = chrome.runtime.getManifest(); |
| 474 if (manifest && manifest.version) { | 477 if (manifest && manifest.version) { |
| 475 this.set_(remoting.ServerLogEntry.KEY_WEBAPP_VERSION_, manifest.version); | 478 this.set_(remoting.ServerLogEntry.KEY_WEBAPP_VERSION_, manifest.version); |
| 476 } | 479 } |
| 477 }; | 480 }; |
| 478 | 481 |
| 479 /** | 482 /** |
| 483 * Adds a field specifying the host version to this log entry. |
| 484 * @param {string} hostVersion Version of the host for current session. |
| 485 * @return {void} Nothing. |
| 486 */ |
| 487 remoting.ServerLogEntry.prototype.addHostVersion = function(hostVersion) { |
| 488 this.set_(remoting.ServerLogEntry.KEY_HOST_VERSION_, hostVersion); |
| 489 }; |
| 490 |
| 491 /** |
| 480 * Adds a field specifying the mode to this log entry. | 492 * Adds a field specifying the mode to this log entry. |
| 481 */ | 493 */ |
| 482 remoting.ServerLogEntry.prototype.addModeField = function() { | 494 remoting.ServerLogEntry.prototype.addModeField = function() { |
| 483 this.set_(remoting.ServerLogEntry.KEY_MODE_, | 495 this.set_(remoting.ServerLogEntry.KEY_MODE_, |
| 484 remoting.ServerLogEntry.getModeField_()); | 496 remoting.ServerLogEntry.getModeField_()); |
| 485 }; | 497 }; |
| 486 | 498 |
| 487 /** | 499 /** |
| 488 * Gets the value of the mode field to be put in a log entry. | 500 * Gets the value of the mode field to be put in a log entry. |
| 489 * | 501 * |
| 490 * @private | 502 * @private |
| 491 * @return {string} | 503 * @return {string} |
| 492 */ | 504 */ |
| 493 remoting.ServerLogEntry.getModeField_ = function() { | 505 remoting.ServerLogEntry.getModeField_ = function() { |
| 494 switch(remoting.app.getConnectionMode()) { | 506 switch(remoting.app.getConnectionMode()) { |
| 495 case remoting.Application.Mode.IT2ME: | 507 case remoting.Application.Mode.IT2ME: |
| 496 return remoting.ServerLogEntry.VALUE_MODE_IT2ME_; | 508 return remoting.ServerLogEntry.VALUE_MODE_IT2ME_; |
| 497 case remoting.Application.Mode.ME2ME: | 509 case remoting.Application.Mode.ME2ME: |
| 498 return remoting.ServerLogEntry.VALUE_MODE_ME2ME_; | 510 return remoting.ServerLogEntry.VALUE_MODE_ME2ME_; |
| 499 case remoting.Application.Mode.APP_REMOTING: | 511 case remoting.Application.Mode.APP_REMOTING: |
| 500 return remoting.ServerLogEntry.VALUE_MODE_APP_REMOTING_; | 512 return remoting.ServerLogEntry.VALUE_MODE_APP_REMOTING_; |
| 501 default: | 513 default: |
| 502 return remoting.ServerLogEntry.VALUE_MODE_UNKNOWN_; | 514 return remoting.ServerLogEntry.VALUE_MODE_UNKNOWN_; |
| 503 } | 515 } |
| 504 }; | 516 }; |
| OLD | NEW |