Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(860)

Side by Side Diff: remoting/webapp/crd/js/log_to_server.js

Issue 955283002: Converted remoting.Error from an enum to a class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 remoting.LogToServer.MAX_SESSION_ID_AGE = 24 * 60 * 60 * 1000; 48 remoting.LogToServer.MAX_SESSION_ID_AGE = 24 * 60 * 60 * 1000;
49 49
50 // The time over which to accumulate connection statistics before logging them 50 // The time over which to accumulate connection statistics before logging them
51 // to the server, in milliseconds. 51 // to the server, in milliseconds.
52 remoting.LogToServer.CONNECTION_STATS_ACCUMULATE_TIME = 60 * 1000; 52 remoting.LogToServer.CONNECTION_STATS_ACCUMULATE_TIME = 60 * 1000;
53 53
54 /** 54 /**
55 * Logs a client session state change. 55 * Logs a client session state change.
56 * 56 *
57 * @param {remoting.ClientSession.State} state 57 * @param {remoting.ClientSession.State} state
58 * @param {remoting.Error} connectionError 58 * @param {!remoting.Error} connectionError
59 */ 59 */
60 remoting.LogToServer.prototype.logClientSessionStateChange = 60 remoting.LogToServer.prototype.logClientSessionStateChange =
61 function(state, connectionError) { 61 function(state, connectionError) {
62 this.maybeExpireSessionId_(); 62 this.maybeExpireSessionId_();
63 // Log the session state change. 63 // Log the session state change.
64 var entry = remoting.ServerLogEntry.makeClientSessionStateChange( 64 var entry = remoting.ServerLogEntry.makeClientSessionStateChange(
65 state, connectionError, this.mode_); 65 state, connectionError, this.mode_);
66 entry.addHostFields(); 66 entry.addHostFields();
67 entry.addChromeVersionField(); 67 entry.addChromeVersionField();
68 entry.addWebappVersionField(); 68 entry.addWebappVersionField();
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698