| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 * Whether a session state is one of the states that occurs at the start of | 102 * Whether a session state is one of the states that occurs at the start of |
| 103 * a session. | 103 * a session. |
| 104 * | 104 * |
| 105 * @private | 105 * @private |
| 106 * @param {remoting.ClientSession.State} state | 106 * @param {remoting.ClientSession.State} state |
| 107 * @return {boolean} | 107 * @return {boolean} |
| 108 */ | 108 */ |
| 109 remoting.LogToServer.isStartOfSession_ = function(state) { | 109 remoting.LogToServer.isStartOfSession_ = function(state) { |
| 110 return ((state == remoting.ClientSession.State.CONNECTING) || | 110 return ((state == remoting.ClientSession.State.CONNECTING) || |
| 111 (state == remoting.ClientSession.State.INITIALIZING) || | 111 (state == remoting.ClientSession.State.INITIALIZING) || |
| 112 (state == remoting.ClientSession.State.AUTHENTICATED) || |
| 112 (state == remoting.ClientSession.State.CONNECTED)); | 113 (state == remoting.ClientSession.State.CONNECTED)); |
| 113 }; | 114 }; |
| 114 | 115 |
| 115 /** | 116 /** |
| 116 * Whether a session state is one of the states that occurs at the end of | 117 * Whether a session state is one of the states that occurs at the end of |
| 117 * a session. | 118 * a session. |
| 118 * | 119 * |
| 119 * @private | 120 * @private |
| 120 * @param {remoting.ClientSession.State} state | 121 * @param {remoting.ClientSession.State} state |
| 121 * @return {boolean} | 122 * @return {boolean} |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 remoting.LogToServer.generateSessionId_ = function() { | 246 remoting.LogToServer.generateSessionId_ = function() { |
| 246 var idArray = []; | 247 var idArray = []; |
| 247 for (var i = 0; i < remoting.LogToServer.SESSION_ID_LEN_; i++) { | 248 for (var i = 0; i < remoting.LogToServer.SESSION_ID_LEN_; i++) { |
| 248 var index = | 249 var index = |
| 249 Math.random() * remoting.LogToServer.SESSION_ID_ALPHABET_.length; | 250 Math.random() * remoting.LogToServer.SESSION_ID_ALPHABET_.length; |
| 250 idArray.push( | 251 idArray.push( |
| 251 remoting.LogToServer.SESSION_ID_ALPHABET_.slice(index, index + 1)); | 252 remoting.LogToServer.SESSION_ID_ALPHABET_.slice(index, index + 1)); |
| 252 } | 253 } |
| 253 return idArray.join(''); | 254 return idArray.join(''); |
| 254 }; | 255 }; |
| OLD | NEW |