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

Unified Diff: remoting/webapp/base/js/log_to_server.js

Issue 1176693002: Add more host-side connection state logging for IT2Me. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer feedback. Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/remoting_webapp_files.gypi ('k') | remoting/webapp/base/js/server_log_entry.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/base/js/log_to_server.js
diff --git a/remoting/webapp/base/js/log_to_server.js b/remoting/webapp/base/js/log_to_server.js
index 42b1ddb7bbcc8217e86413255865f46f8e9966b6..7cb0043da0aef009305ade7a72fcd2e55afecda1 100644
--- a/remoting/webapp/base/js/log_to_server.js
+++ b/remoting/webapp/base/js/log_to_server.js
@@ -14,9 +14,11 @@ var remoting = remoting || {};
/**
* @param {remoting.SignalStrategy} signalStrategy Signal strategy.
+ * @param {boolean=} opt_isHost True if this instance should log role=host
+ * events rather than role=client.
* @constructor
*/
-remoting.LogToServer = function(signalStrategy) {
+remoting.LogToServer = function(signalStrategy, opt_isHost) {
/** @private */
this.statsAccumulator_ = new remoting.StatsAccumulator();
/** @private */
@@ -35,8 +37,10 @@ remoting.LogToServer = function(signalStrategy) {
this.hostVersion_ = '';
/** @private */
this.logEntryMode_ = remoting.ServerLogEntry.VALUE_MODE_UNKNOWN;
+ /** @private */
+ this.role_ = opt_isHost ? 'host' : 'client';
- this.setSessionId_();
+ this.setSessionId();
signalStrategy.sendConnectionSetupResults(this);
};
@@ -65,7 +69,7 @@ remoting.LogToServer.prototype.logClientSessionStateChange =
this.maybeExpireSessionId_();
// Log the session state change.
var entry = remoting.ServerLogEntry.makeClientSessionStateChange(
- state, connectionError, this.logEntryMode_);
+ state, connectionError, this.logEntryMode_, this.role_);
entry.addClientOSFields();
entry.addChromeVersionField();
entry.addWebappVersionField();
@@ -204,10 +208,8 @@ remoting.LogToServer.prototype.log_ = function(entry) {
/**
* Sets the session ID to a random string.
- *
- * @private
*/
-remoting.LogToServer.prototype.setSessionId_ = function() {
+remoting.LogToServer.prototype.setSessionId = function() {
this.sessionId_ = remoting.LogToServer.generateSessionId_();
this.sessionIdGenerationTime_ = new Date().getTime();
};
@@ -239,7 +241,7 @@ remoting.LogToServer.prototype.maybeExpireSessionId_ = function() {
this.logEntryMode_);
this.log_(entry);
// Generate a new session ID.
- this.setSessionId_();
+ this.setSessionId();
// Log the new session ID.
entry = remoting.ServerLogEntry.makeSessionIdNew(this.sessionId_,
this.logEntryMode_);
« no previous file with comments | « remoting/remoting_webapp_files.gypi ('k') | remoting/webapp/base/js/server_log_entry.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698