| 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 * Module for sending log entries to the server. | 7 * Module for sending log entries to the server. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 'use strict'; | 10 'use strict'; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 /** @private */ | 23 /** @private */ |
| 24 this.sessionId_ = ''; | 24 this.sessionId_ = ''; |
| 25 /** @private */ | 25 /** @private */ |
| 26 this.sessionIdGenerationTime_ = 0; | 26 this.sessionIdGenerationTime_ = 0; |
| 27 /** @private */ | 27 /** @private */ |
| 28 this.sessionStartTime_ = new Date().getTime(); | 28 this.sessionStartTime_ = new Date().getTime(); |
| 29 /** @private */ | 29 /** @private */ |
| 30 this.signalStrategy_ = signalStrategy; | 30 this.signalStrategy_ = signalStrategy; |
| 31 /** @private */ | 31 /** @private */ |
| 32 this.mode_ = mode; | 32 this.mode_ = mode; |
| 33 /** @type {string} @private */ | 33 /** @private {string} */ |
| 34 this.connectionType_ = ''; | 34 this.connectionType_ = ''; |
| 35 | 35 |
| 36 this.setSessionId_(); | 36 this.setSessionId_(); |
| 37 signalStrategy.sendConnectionSetupResults(this); | 37 signalStrategy.sendConnectionSetupResults(this); |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 // Constants used for generating a session ID. | 40 // Constants used for generating a session ID. |
| 41 /** @private */ | 41 /** @private */ |
| 42 remoting.LogToServer.SESSION_ID_ALPHABET_ = | 42 remoting.LogToServer.SESSION_ID_ALPHABET_ = |
| 43 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; | 43 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 remoting.LogToServer.generateSessionId_ = function() { | 245 remoting.LogToServer.generateSessionId_ = function() { |
| 246 var idArray = []; | 246 var idArray = []; |
| 247 for (var i = 0; i < remoting.LogToServer.SESSION_ID_LEN_; i++) { | 247 for (var i = 0; i < remoting.LogToServer.SESSION_ID_LEN_; i++) { |
| 248 var index = | 248 var index = |
| 249 Math.random() * remoting.LogToServer.SESSION_ID_ALPHABET_.length; | 249 Math.random() * remoting.LogToServer.SESSION_ID_ALPHABET_.length; |
| 250 idArray.push( | 250 idArray.push( |
| 251 remoting.LogToServer.SESSION_ID_ALPHABET_.slice(index, index + 1)); | 251 remoting.LogToServer.SESSION_ID_ALPHABET_.slice(index, index + 1)); |
| 252 } | 252 } |
| 253 return idArray.join(''); | 253 return idArray.join(''); |
| 254 }; | 254 }; |
| OLD | NEW |