| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 remoting.ServerLogEntry.KEY_MODE_ = 'mode'; | 168 remoting.ServerLogEntry.KEY_MODE_ = 'mode'; |
| 169 /** @private */ | 169 /** @private */ |
| 170 remoting.ServerLogEntry.VALUE_MODE_IT2ME_ = 'it2me'; | 170 remoting.ServerLogEntry.VALUE_MODE_IT2ME_ = 'it2me'; |
| 171 /** @private */ | 171 /** @private */ |
| 172 remoting.ServerLogEntry.VALUE_MODE_ME2ME_ = 'me2me'; | 172 remoting.ServerLogEntry.VALUE_MODE_ME2ME_ = 'me2me'; |
| 173 /** @private */ | 173 /** @private */ |
| 174 remoting.ServerLogEntry.VALUE_MODE_APP_REMOTING_ = 'lgapp'; | 174 remoting.ServerLogEntry.VALUE_MODE_APP_REMOTING_ = 'lgapp'; |
| 175 /** @private */ | 175 /** @private */ |
| 176 remoting.ServerLogEntry.VALUE_MODE_UNKNOWN_ = 'unknown'; | 176 remoting.ServerLogEntry.VALUE_MODE_UNKNOWN_ = 'unknown'; |
| 177 | 177 |
| 178 /** @private */ |
| 179 remoting.ServerLogEntry.KEY_APP_ID_ = 'application-id'; |
| 180 |
| 178 /** | 181 /** |
| 179 * Sets one field in this log entry. | 182 * Sets one field in this log entry. |
| 180 * | 183 * |
| 181 * @private | 184 * @private |
| 182 * @param {string} key | 185 * @param {string} key |
| 183 * @param {string} value | 186 * @param {string} value |
| 184 */ | 187 */ |
| 185 remoting.ServerLogEntry.prototype.set_ = function(key, value) { | 188 remoting.ServerLogEntry.prototype.set_ = function(key, value) { |
| 186 this.dict[key] = value; | 189 this.dict[key] = value; |
| 187 }; | 190 }; |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 | 481 |
| 479 /** | 482 /** |
| 480 * Adds a field specifying the mode to this log entry. | 483 * Adds a field specifying the mode to this log entry. |
| 481 */ | 484 */ |
| 482 remoting.ServerLogEntry.prototype.addModeField = function() { | 485 remoting.ServerLogEntry.prototype.addModeField = function() { |
| 483 this.set_(remoting.ServerLogEntry.KEY_MODE_, | 486 this.set_(remoting.ServerLogEntry.KEY_MODE_, |
| 484 remoting.ServerLogEntry.getModeField_()); | 487 remoting.ServerLogEntry.getModeField_()); |
| 485 }; | 488 }; |
| 486 | 489 |
| 487 /** | 490 /** |
| 491 * Adds a field specifying the application ID to this log entry. |
| 492 * @param {string} appId The application ID to use. |
| 493 * @return {void} Nothin. |
| 494 */ |
| 495 remoting.ServerLogEntry.prototype.addApplicationId = function(appId) { |
| 496 this.set_(remoting.ServerLogEntry.KEY_APP_ID_, appId); |
| 497 }; |
| 498 |
| 499 |
| 500 /** |
| 488 * Gets the value of the mode field to be put in a log entry. | 501 * Gets the value of the mode field to be put in a log entry. |
| 489 * | 502 * |
| 490 * @private | 503 * @private |
| 491 * @return {string} | 504 * @return {string} |
| 492 */ | 505 */ |
| 493 remoting.ServerLogEntry.getModeField_ = function() { | 506 remoting.ServerLogEntry.getModeField_ = function() { |
| 494 switch(remoting.app.getConnectionMode()) { | 507 switch(remoting.app.getConnectionMode()) { |
| 495 case remoting.Application.Mode.IT2ME: | 508 case remoting.Application.Mode.IT2ME: |
| 496 return remoting.ServerLogEntry.VALUE_MODE_IT2ME_; | 509 return remoting.ServerLogEntry.VALUE_MODE_IT2ME_; |
| 497 case remoting.Application.Mode.ME2ME: | 510 case remoting.Application.Mode.ME2ME: |
| 498 return remoting.ServerLogEntry.VALUE_MODE_ME2ME_; | 511 return remoting.ServerLogEntry.VALUE_MODE_ME2ME_; |
| 499 case remoting.Application.Mode.APP_REMOTING: | 512 case remoting.Application.Mode.APP_REMOTING: |
| 500 return remoting.ServerLogEntry.VALUE_MODE_APP_REMOTING_; | 513 return remoting.ServerLogEntry.VALUE_MODE_APP_REMOTING_; |
| 501 default: | 514 default: |
| 502 return remoting.ServerLogEntry.VALUE_MODE_UNKNOWN_; | 515 return remoting.ServerLogEntry.VALUE_MODE_UNKNOWN_; |
| 503 } | 516 } |
| 504 }; | 517 }; |
| OLD | NEW |