Commit 2d5dba6c authored by jamiewalch's avatar jamiewalch Committed by Commit bot

Include the session id in feedback logs.

BUG=b/19776978

Review URL: https://codereview.chromium.org/1131853004

Cr-Commit-Position: refs/heads/master@{#330007}
parent f2ba95e3
...@@ -50,8 +50,8 @@ remoting.AppConnectedView = function(containerElement, connectionInfo) { ...@@ -50,8 +50,8 @@ remoting.AppConnectedView = function(containerElement, connectionInfo) {
new remoting.ContextMenuDom(document.getElementById('context-menu')); new remoting.ContextMenuDom(document.getElementById('context-menu'));
} }
this.contextMenu_ = this.contextMenu_ = new remoting.ApplicationContextMenu(
new remoting.ApplicationContextMenu(menuAdapter, this.plugin_); menuAdapter, this.plugin_, connectionInfo.session());
this.contextMenu_.setHostId(connectionInfo.host().hostId); this.contextMenu_.setHostId(connectionInfo.host().hostId);
/** @private */ /** @private */
......
...@@ -15,13 +15,18 @@ var remoting = remoting || {}; ...@@ -15,13 +15,18 @@ var remoting = remoting || {};
/** /**
* @param {remoting.ContextMenuAdapter} adapter * @param {remoting.ContextMenuAdapter} adapter
* @param {remoting.ClientPlugin} plugin * @param {remoting.ClientPlugin} plugin
* @param {remoting.ClientSession} clientSession
*
* @constructor * @constructor
* @implements {base.Disposable} * @implements {base.Disposable}
*/ */
remoting.ApplicationContextMenu = function(adapter, plugin) { remoting.ApplicationContextMenu = function(adapter, plugin, clientSession) {
/** @private {remoting.ContextMenuAdapter} */ /** @private */
this.adapter_ = adapter; this.adapter_ = adapter;
/** @private */
this.clientSession_ = clientSession;
this.adapter_.create( this.adapter_.create(
remoting.ApplicationContextMenu.kSendFeedbackId, remoting.ApplicationContextMenu.kSendFeedbackId,
l10n.getTranslationOrError(/*i18n-content*/'SEND_FEEDBACK'), l10n.getTranslationOrError(/*i18n-content*/'SEND_FEEDBACK'),
...@@ -94,7 +99,8 @@ remoting.ApplicationContextMenu.prototype.onClicked_ = function(info) { ...@@ -94,7 +99,8 @@ remoting.ApplicationContextMenu.prototype.onClicked_ = function(info) {
var message = { var message = {
method: 'init', method: 'init',
hostId: that.hostId_, hostId: that.hostId_,
connectionStats: JSON.stringify(that.stats_.mostRecent()) connectionStats: JSON.stringify(that.stats_.mostRecent()),
sessionId: that.clientSession_.getLogger().getSessionId()
}; };
consentWindow.contentWindow.postMessage(message, '*'); consentWindow.contentWindow.postMessage(message, '*');
}; };
......
...@@ -17,6 +17,12 @@ var hostId = '@pending'; ...@@ -17,6 +17,12 @@ var hostId = '@pending';
*/ */
var connectionStats = ''; var connectionStats = '';
/**
* @type {string} The most recent id for the session (unless the session is
* longer than 24hrs, this will be the only session id).
*/
var sessionId = '';
/** /**
* @type {string} "no" => user did not request a VM reset; "yes" => VM was * @type {string} "no" => user did not request a VM reset; "yes" => VM was
* successfully reset; "failed" => user requested a reset, but it failed. * successfully reset; "failed" => user requested a reset, but it failed.
...@@ -66,7 +72,8 @@ function onUserInfo(email, realName) { ...@@ -66,7 +72,8 @@ function onUserInfo(email, realName) {
'&psd_abandonHost=' + escape(abandonHost) + '&psd_abandonHost=' + escape(abandonHost) +
'&psd_crashServiceReportId=' + escape(crashServiceReportId) + '&psd_crashServiceReportId=' + escape(crashServiceReportId) +
'&psd_connectionStats=' + escape(connectionStats) + '&psd_connectionStats=' + escape(connectionStats) +
'&psd_category=' + escape(selectedCategory)); '&psd_category=' + escape(selectedCategory) +
'&psd_sessionId=' + escape(sessionId));
window.close(); window.close();
// If the VM was successfully abandoned, close the application. // If the VM was successfully abandoned, close the application.
...@@ -242,6 +249,7 @@ function onWindowMessage(event) { ...@@ -242,6 +249,7 @@ function onWindowMessage(event) {
hostId = /** @type {string} */ (event.data['hostId']); hostId = /** @type {string} */ (event.data['hostId']);
} }
connectionStats = /** @type {string} */ (event.data['connectionStats']); connectionStats = /** @type {string} */ (event.data['connectionStats']);
sessionId = /** @type {string} */ (event.data['sessionId']);
} }
}; };
......
...@@ -604,4 +604,3 @@ remoting.ClientSession.prototype.reportStatistics = function() { ...@@ -604,4 +604,3 @@ remoting.ClientSession.prototype.reportStatistics = function() {
remoting.ClientSession.prototype.logHostOfflineErrors = function(enable) { remoting.ClientSession.prototype.logHostOfflineErrors = function(enable) {
this.logHostOfflineErrors_ = enable; this.logHostOfflineErrors_ = enable;
}; };
...@@ -109,6 +109,14 @@ remoting.LogToServer.prototype.logSignalStrategyProgress = ...@@ -109,6 +109,14 @@ remoting.LogToServer.prototype.logSignalStrategyProgress =
this.log_(entry); this.log_(entry);
}; };
/**
* @return {string} The current session id. This is random GUID, refreshed
* every 24hrs.
*/
remoting.LogToServer.prototype.getSessionId = function() {
return this.sessionId_;
};
/** /**
* Whether a session state is one of the states that occurs at the start of * Whether a session state is one of the states that occurs at the start of
* a session. * a session.
...@@ -286,4 +294,3 @@ remoting.LogToServer.prototype.setAuthTotalTime = function(totalTime) { ...@@ -286,4 +294,3 @@ remoting.LogToServer.prototype.setAuthTotalTime = function(totalTime) {
remoting.LogToServer.prototype.setHostVersion = function(hostVersion) { remoting.LogToServer.prototype.setHostVersion = function(hostVersion) {
this.hostVersion_ = hostVersion; this.hostVersion_ = hostVersion;
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment