diff options
author | jamiewalch <jamiewalch@chromium.org> | 2015-05-14 18:20:57 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-15 01:21:03 +0000 |
commit | 2d5dba6c3020b037973da36a1808ffae361805f1 (patch) | |
tree | 7abfe9c60377617046b2f2d6c0b967bd2951b156 | |
parent | f2ba95e366d3dba58ee697f2a2ca7394b79cc645 (diff) | |
download | chromium_src-2d5dba6c3020b037973da36a1808ffae361805f1.zip chromium_src-2d5dba6c3020b037973da36a1808ffae361805f1.tar.gz chromium_src-2d5dba6c3020b037973da36a1808ffae361805f1.tar.bz2 |
Include the session id in feedback logs.
BUG=b/19776978
Review URL: https://codereview.chromium.org/1131853004
Cr-Commit-Position: refs/heads/master@{#330007}
-rw-r--r-- | remoting/webapp/app_remoting/js/app_connected_view.js | 4 | ||||
-rw-r--r-- | remoting/webapp/app_remoting/js/application_context_menu.js | 12 | ||||
-rw-r--r-- | remoting/webapp/app_remoting/js/feedback_consent.js | 10 | ||||
-rw-r--r-- | remoting/webapp/base/js/client_session.js | 1 | ||||
-rw-r--r-- | remoting/webapp/base/js/log_to_server.js | 9 |
5 files changed, 28 insertions, 8 deletions
diff --git a/remoting/webapp/app_remoting/js/app_connected_view.js b/remoting/webapp/app_remoting/js/app_connected_view.js index 0ba7b57..0ae1a0f 100644 --- a/remoting/webapp/app_remoting/js/app_connected_view.js +++ b/remoting/webapp/app_remoting/js/app_connected_view.js @@ -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 */ diff --git a/remoting/webapp/app_remoting/js/application_context_menu.js b/remoting/webapp/app_remoting/js/application_context_menu.js index ae1b4b0..e607814 100644 --- a/remoting/webapp/app_remoting/js/application_context_menu.js +++ b/remoting/webapp/app_remoting/js/application_context_menu.js @@ -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, '*'); }; diff --git a/remoting/webapp/app_remoting/js/feedback_consent.js b/remoting/webapp/app_remoting/js/feedback_consent.js index ef9a0ec..7d81521 100644 --- a/remoting/webapp/app_remoting/js/feedback_consent.js +++ b/remoting/webapp/app_remoting/js/feedback_consent.js @@ -18,6 +18,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']); } }; diff --git a/remoting/webapp/base/js/client_session.js b/remoting/webapp/base/js/client_session.js index db13e65..ff4c737 100644 --- a/remoting/webapp/base/js/client_session.js +++ b/remoting/webapp/base/js/client_session.js @@ -604,4 +604,3 @@ remoting.ClientSession.prototype.reportStatistics = function() { remoting.ClientSession.prototype.logHostOfflineErrors = function(enable) { this.logHostOfflineErrors_ = enable; }; - diff --git a/remoting/webapp/base/js/log_to_server.js b/remoting/webapp/base/js/log_to_server.js index 18c7e64..e68a001 100644 --- a/remoting/webapp/base/js/log_to_server.js +++ b/remoting/webapp/base/js/log_to_server.js @@ -110,6 +110,14 @@ remoting.LogToServer.prototype.logSignalStrategyProgress = }; /** + * @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; }; - |