OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 /** @suppress {duplicate} */ | 6 /** @suppress {duplicate} */ |
7 var remoting = remoting || {}; | 7 var remoting = remoting || {}; |
8 | 8 |
9 (function() { | 9 (function() { |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 /** @private */ | 44 /** @private */ |
45 this.hostVersion_ = ''; | 45 this.hostVersion_ = ''; |
46 /** @private {remoting.ChromotingEvent.Os}*/ | 46 /** @private {remoting.ChromotingEvent.Os}*/ |
47 this.hostOS_ = remoting.ChromotingEvent.Os.OTHER; | 47 this.hostOS_ = remoting.ChromotingEvent.Os.OTHER; |
48 /** @private */ | 48 /** @private */ |
49 this.hostOSVersion_ = ''; | 49 this.hostOSVersion_ = ''; |
50 /** @private {number} */ | 50 /** @private {number} */ |
51 this.hostStatusUpdateElapsedTime_; | 51 this.hostStatusUpdateElapsedTime_; |
52 /** @private */ | 52 /** @private */ |
53 this.mode_ = remoting.ChromotingEvent.Mode.ME2ME; | 53 this.mode_ = remoting.ChromotingEvent.Mode.ME2ME; |
| 54 /** @private {remoting.ChromotingEvent.AuthMethod} */ |
| 55 this.authMethod_; |
54 | 56 |
55 this.setSessionId_(); | 57 this.setSessionId_(); |
56 }; | 58 }; |
57 | 59 |
58 /** | 60 /** |
59 * @param {remoting.ChromotingEvent.SessionEntryPoint} entryPoint | 61 * @param {remoting.ChromotingEvent.SessionEntryPoint} entryPoint |
60 */ | 62 */ |
61 remoting.SessionLogger.prototype.setEntryPoint = function(entryPoint) { | 63 remoting.SessionLogger.prototype.setEntryPoint = function(entryPoint) { |
62 this.entryPoint_ = entryPoint; | 64 this.entryPoint_ = entryPoint; |
63 }; | 65 }; |
(...skipping 28 matching lines...) Expand all Loading... |
92 remoting.SessionLogger.prototype.setConnectionType = function(connectionType) { | 94 remoting.SessionLogger.prototype.setConnectionType = function(connectionType) { |
93 this.connectionType_ = toConnectionType(connectionType); | 95 this.connectionType_ = toConnectionType(connectionType); |
94 }; | 96 }; |
95 | 97 |
96 /** @override {remoting.Logger} */ | 98 /** @override {remoting.Logger} */ |
97 remoting.SessionLogger.prototype.setLogEntryMode = function(mode) { | 99 remoting.SessionLogger.prototype.setLogEntryMode = function(mode) { |
98 this.mode_ = mode; | 100 this.mode_ = mode; |
99 }; | 101 }; |
100 | 102 |
101 /** @override {remoting.Logger} */ | 103 /** @override {remoting.Logger} */ |
| 104 remoting.SessionLogger.prototype.setAuthMethod = function(authMethod) { |
| 105 this.authMethod_ = authMethod; |
| 106 }; |
| 107 |
| 108 /** @override {remoting.Logger} */ |
102 remoting.SessionLogger.prototype.getSessionId = function() { | 109 remoting.SessionLogger.prototype.getSessionId = function() { |
103 return this.sessionId_; | 110 return this.sessionId_; |
104 }; | 111 }; |
105 | 112 |
106 /** @override {remoting.Logger} */ | 113 /** @override {remoting.Logger} */ |
107 remoting.SessionLogger.prototype.logSignalStrategyProgress = | 114 remoting.SessionLogger.prototype.logSignalStrategyProgress = |
108 function(strategyType, progress) { | 115 function(strategyType, progress) { |
109 this.maybeExpireSessionId_(); | 116 this.maybeExpireSessionId_(); |
110 var entry = new remoting.ChromotingEvent( | 117 var entry = new remoting.ChromotingEvent( |
111 remoting.ChromotingEvent.Type.SIGNAL_STRATEGY_PROGRESS); | 118 remoting.ChromotingEvent.Type.SIGNAL_STRATEGY_PROGRESS); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 var sessionDurationInSeconds = | 260 var sessionDurationInSeconds = |
254 (new Date().getTime() - this.sessionStartTime_ - | 261 (new Date().getTime() - this.sessionStartTime_ - |
255 this.authTotalTime_) / 1000.0; | 262 this.authTotalTime_) / 1000.0; |
256 entry.session_duration = sessionDurationInSeconds; | 263 entry.session_duration = sessionDurationInSeconds; |
257 if (Boolean(this.connectionType_)) { | 264 if (Boolean(this.connectionType_)) { |
258 entry.connection_type = this.connectionType_; | 265 entry.connection_type = this.connectionType_; |
259 } | 266 } |
260 if (this.hostStatusUpdateElapsedTime_ != undefined) { | 267 if (this.hostStatusUpdateElapsedTime_ != undefined) { |
261 entry.host_status_update_elapsed_time = this.hostStatusUpdateElapsedTime_; | 268 entry.host_status_update_elapsed_time = this.hostStatusUpdateElapsedTime_; |
262 } | 269 } |
| 270 if (this.authMethod_ != undefined) { |
| 271 entry.auth_method = this.authMethod_; |
| 272 } |
263 entry.host_version = this.hostVersion_; | 273 entry.host_version = this.hostVersion_; |
264 entry.host_os = this.hostOS_; | 274 entry.host_os = this.hostOS_; |
265 entry.host_os_version = this.hostOSVersion_; | 275 entry.host_os_version = this.hostOSVersion_; |
266 }; | 276 }; |
267 | 277 |
268 /** | 278 /** |
269 * Sends a log entry to the server. | 279 * Sends a log entry to the server. |
270 * @param {remoting.ChromotingEvent} entry | 280 * @param {remoting.ChromotingEvent} entry |
271 * @private | 281 * @private |
272 */ | 282 */ |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 case 'stun': | 451 case 'stun': |
442 return remoting.ChromotingEvent.ConnectionType.STUN; | 452 return remoting.ChromotingEvent.ConnectionType.STUN; |
443 case 'relay': | 453 case 'relay': |
444 return remoting.ChromotingEvent.ConnectionType.RELAY; | 454 return remoting.ChromotingEvent.ConnectionType.RELAY; |
445 default: | 455 default: |
446 throw new Error('Unknown ConnectionType :=' + type); | 456 throw new Error('Unknown ConnectionType :=' + type); |
447 } | 457 } |
448 } | 458 } |
449 | 459 |
450 })(); | 460 })(); |
OLD | NEW |