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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 remoting.ServerLogEntry.KEY_MODE_ = 'mode'; | 171 remoting.ServerLogEntry.KEY_MODE_ = 'mode'; |
172 /** @private */ | 172 /** @private */ |
173 remoting.ServerLogEntry.VALUE_MODE_IT2ME_ = 'it2me'; | 173 remoting.ServerLogEntry.VALUE_MODE_IT2ME_ = 'it2me'; |
174 /** @private */ | 174 /** @private */ |
175 remoting.ServerLogEntry.VALUE_MODE_ME2ME_ = 'me2me'; | 175 remoting.ServerLogEntry.VALUE_MODE_ME2ME_ = 'me2me'; |
176 /** @private */ | 176 /** @private */ |
177 remoting.ServerLogEntry.VALUE_MODE_APP_REMOTING_ = 'lgapp'; | 177 remoting.ServerLogEntry.VALUE_MODE_APP_REMOTING_ = 'lgapp'; |
178 /** @private */ | 178 /** @private */ |
179 remoting.ServerLogEntry.VALUE_MODE_UNKNOWN_ = 'unknown'; | 179 remoting.ServerLogEntry.VALUE_MODE_UNKNOWN_ = 'unknown'; |
180 | 180 |
| 181 /** @private */ |
| 182 remoting.ServerLogEntry.KEY_APP_ID_ = 'application-id'; |
| 183 |
181 /** | 184 /** |
182 * Sets one field in this log entry. | 185 * Sets one field in this log entry. |
183 * | 186 * |
184 * @private | 187 * @private |
185 * @param {string} key | 188 * @param {string} key |
186 * @param {string} value | 189 * @param {string} value |
187 */ | 190 */ |
188 remoting.ServerLogEntry.prototype.set_ = function(key, value) { | 191 remoting.ServerLogEntry.prototype.set_ = function(key, value) { |
189 this.dict[key] = value; | 192 this.dict[key] = value; |
190 }; | 193 }; |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 | 493 |
491 /** | 494 /** |
492 * Adds a field specifying the mode to this log entry. | 495 * Adds a field specifying the mode to this log entry. |
493 */ | 496 */ |
494 remoting.ServerLogEntry.prototype.addModeField = function() { | 497 remoting.ServerLogEntry.prototype.addModeField = function() { |
495 this.set_(remoting.ServerLogEntry.KEY_MODE_, | 498 this.set_(remoting.ServerLogEntry.KEY_MODE_, |
496 remoting.ServerLogEntry.getModeField_()); | 499 remoting.ServerLogEntry.getModeField_()); |
497 }; | 500 }; |
498 | 501 |
499 /** | 502 /** |
| 503 * Adds a field specifying the application ID to this log entry. |
| 504 * @return {void} Nothing. |
| 505 */ |
| 506 remoting.ServerLogEntry.prototype.addApplicationId = function() { |
| 507 this.set_(remoting.ServerLogEntry.KEY_APP_ID_, chrome.runtime.id); |
| 508 }; |
| 509 |
| 510 |
| 511 /** |
500 * Gets the value of the mode field to be put in a log entry. | 512 * Gets the value of the mode field to be put in a log entry. |
501 * | 513 * |
502 * @private | 514 * @private |
503 * @return {string} | 515 * @return {string} |
504 */ | 516 */ |
505 remoting.ServerLogEntry.getModeField_ = function() { | 517 remoting.ServerLogEntry.getModeField_ = function() { |
506 switch(remoting.app.getConnectionMode()) { | 518 switch(remoting.app.getConnectionMode()) { |
507 case remoting.Application.Mode.IT2ME: | 519 case remoting.Application.Mode.IT2ME: |
508 return remoting.ServerLogEntry.VALUE_MODE_IT2ME_; | 520 return remoting.ServerLogEntry.VALUE_MODE_IT2ME_; |
509 case remoting.Application.Mode.ME2ME: | 521 case remoting.Application.Mode.ME2ME: |
510 return remoting.ServerLogEntry.VALUE_MODE_ME2ME_; | 522 return remoting.ServerLogEntry.VALUE_MODE_ME2ME_; |
511 case remoting.Application.Mode.APP_REMOTING: | 523 case remoting.Application.Mode.APP_REMOTING: |
512 return remoting.ServerLogEntry.VALUE_MODE_APP_REMOTING_; | 524 return remoting.ServerLogEntry.VALUE_MODE_APP_REMOTING_; |
513 default: | 525 default: |
514 return remoting.ServerLogEntry.VALUE_MODE_UNKNOWN_; | 526 return remoting.ServerLogEntry.VALUE_MODE_UNKNOWN_; |
515 } | 527 } |
516 }; | 528 }; |
OLD | NEW |