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) {
new remoting.ContextMenuDom(document.getElementById('context-menu'));
}
this.contextMenu_ =
new remoting.ApplicationContextMenu(menuAdapter, this.plugin_);
this.contextMenu_ = new remoting.ApplicationContextMenu(
menuAdapter, this.plugin_, connectionInfo.session());
this.contextMenu_.setHostId(connectionInfo.host().hostId);
/** @private */
......
......@@ -15,13 +15,18 @@ var remoting = remoting || {};
/**
* @param {remoting.ContextMenuAdapter} adapter
* @param {remoting.ClientPlugin} plugin
* @param {remoting.ClientSession} clientSession
*
* @constructor
* @implements {base.Disposable}
*/
remoting.ApplicationContextMenu = function(adapter, plugin) {
/** @private {remoting.ContextMenuAdapter} */
remoting.ApplicationContextMenu = function(adapter, plugin, clientSession) {
/** @private */
this.adapter_ = adapter;
/** @private */
this.clientSession_ = clientSession;
this.adapter_.create(
remoting.ApplicationContextMenu.kSendFeedbackId,
l10n.getTranslationOrError(/*i18n-content*/'SEND_FEEDBACK'),
......@@ -94,7 +99,8 @@ remoting.ApplicationContextMenu.prototype.onClicked_ = function(info) {
var message = {
method: 'init',
hostId: that.hostId_,
connectionStats: JSON.stringify(that.stats_.mostRecent())
connectionStats: JSON.stringify(that.stats_.mostRecent()),
sessionId: that.clientSession_.getLogger().getSessionId()
};
consentWindow.contentWindow.postMessage(message, '*');
};
......
......@@ -17,6 +17,12 @@ var hostId = '@pending';
*/
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
* successfully reset; "failed" => user requested a reset, but it failed.
......@@ -66,7 +72,8 @@ function onUserInfo(email, realName) {
'&psd_abandonHost=' + escape(abandonHost) +
'&psd_crashServiceReportId=' + escape(crashServiceReportId) +
'&psd_connectionStats=' + escape(connectionStats) +
'&psd_category=' + escape(selectedCategory));
'&psd_category=' + escape(selectedCategory) +
'&psd_sessionId=' + escape(sessionId));
window.close();
// If the VM was successfully abandoned, close the application.
......@@ -242,6 +249,7 @@ function onWindowMessage(event) {
hostId = /** @type {string} */ (event.data['hostId']);
}
connectionStats = /** @type {string} */ (event.data['connectionStats']);
sessionId = /** @type {string} */ (event.data['sessionId']);
}
};
......
......@@ -604,4 +604,3 @@ remoting.ClientSession.prototype.reportStatistics = function() {
remoting.ClientSession.prototype.logHostOfflineErrors = function(enable) {
this.logHostOfflineErrors_ = enable;
};
......@@ -109,6 +109,14 @@ remoting.LogToServer.prototype.logSignalStrategyProgress =
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
* a session.
......@@ -286,4 +294,3 @@ remoting.LogToServer.prototype.setAuthTotalTime = function(totalTime) {
remoting.LogToServer.prototype.setHostVersion = function(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