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

Unified Diff: remoting/webapp/me2mom/server_log_entry.js

Issue 8893015: The chromoting client logs a session ID to the server, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Allow for session ID expiry. Created 9 years 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/webapp/me2mom/log_to_server.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/me2mom/server_log_entry.js
diff --git a/remoting/webapp/me2mom/server_log_entry.js b/remoting/webapp/me2mom/server_log_entry.js
index a8755b9d84b6681021148a72eb1a67199ccb8d45..29178bc9f742d6a76c191d2b7bcb2163f9d979b3 100644
--- a/remoting/webapp/me2mom/server_log_entry.js
+++ b/remoting/webapp/me2mom/server_log_entry.js
@@ -27,7 +27,7 @@ remoting.ServerLogEntry.VALUE_EVENT_NAME_SESSION_STATE_ =
'session-state';
/** @private */
-remoting.ServerLogEntry.KEY_ID_ = 'id';
+remoting.ServerLogEntry.KEY_SESSION_ID_ = 'session-id';
/** @private */
remoting.ServerLogEntry.KEY_ROLE_ = 'role';
@@ -132,6 +132,12 @@ remoting.ServerLogEntry.KEY_BROWSER_VERSION_ = 'browser-version';
/** @private */
remoting.ServerLogEntry.KEY_WEBAPP_VERSION_ = 'webapp-version';
+/** @private */
+remoting.ServerLogEntry.VALUE_EVENT_NAME_SESSION_ID_OLD_ = 'session-id-old';
+
+/** @private */
+remoting.ServerLogEntry.VALUE_EVENT_NAME_SESSION_ID_NEW_ = 'session-id-new';
+
/**
* Sets one field in this log entry.
*
@@ -249,12 +255,44 @@ remoting.ServerLogEntry.prototype.addStatsField = function(
};
/**
- * Adds an ID field to this log entry.
+ * Makes a log entry for a "this session ID is old" event.
+ *
+ * @param {string} sessionId
+ * @return {remoting.ServerLogEntry}
+ */
+remoting.ServerLogEntry.makeSessionIdOld = function(sessionId) {
+ var entry = new remoting.ServerLogEntry();
+ entry.set(remoting.ServerLogEntry.KEY_ROLE_,
+ remoting.ServerLogEntry.VALUE_ROLE_CLIENT_);
+ entry.set(remoting.ServerLogEntry.KEY_EVENT_NAME_,
+ remoting.ServerLogEntry.VALUE_EVENT_NAME_SESSION_ID_OLD_);
+ entry.addSessionIdField(sessionId);
+ return entry;
+};
+
+/**
+ * Makes a log entry for a "this session ID is new" event.
+ *
+ * @param {string} sessionId
+ * @return {remoting.ServerLogEntry}
+ */
+remoting.ServerLogEntry.makeSessionIdNew = function(sessionId) {
+ var entry = new remoting.ServerLogEntry();
+ entry.set(remoting.ServerLogEntry.KEY_ROLE_,
+ remoting.ServerLogEntry.VALUE_ROLE_CLIENT_);
+ entry.set(remoting.ServerLogEntry.KEY_EVENT_NAME_,
+ remoting.ServerLogEntry.VALUE_EVENT_NAME_SESSION_ID_NEW_);
+ entry.addSessionIdField(sessionId);
+ return entry;
+};
+
+/**
+ * Adds a session ID field to this log entry.
*
- * @param {string} id
+ * @param {string} sessionId
*/
-remoting.ServerLogEntry.prototype.addIdField = function(id) {
- this.set(remoting.ServerLogEntry.KEY_ID_, id);
+remoting.ServerLogEntry.prototype.addSessionIdField = function(sessionId) {
+ this.set(remoting.ServerLogEntry.KEY_SESSION_ID_, sessionId);
}
/**
« no previous file with comments | « remoting/webapp/me2mom/log_to_server.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698