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

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

Issue 1410563006: [Chromoting] SessionLogger refactor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 1 month 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 | « no previous file | remoting/webapp/base/js/client_session.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/base/js/chromoting_event.js
diff --git a/remoting/webapp/base/js/chromoting_event.js b/remoting/webapp/base/js/chromoting_event.js
index 88cd4f94c27b59510c287349c5836b3eb276f369..7bd21df041cf26f430bf3561d52acbe1b7f15311 100644
--- a/remoting/webapp/base/js/chromoting_event.js
+++ b/remoting/webapp/base/js/chromoting_event.js
@@ -122,6 +122,29 @@ remoting.ChromotingEvent.prototype.init_ = function() {
};
/**
+ * Populates the corresponding fields in the logEntry based on |error|.
+ *
+ * @param {remoting.Error} error
+ */
+remoting.ChromotingEvent.prototype.setError = function(error) {
+ var Tag = remoting.Error.Tag;
+ var detail = /** @type {string} */ (error.getDetail());
+
+ switch (error.getTag()) {
+ case Tag.HOST_IS_OFFLINE:
+ if (detail) {
+ this.xmpp_error = new remoting.ChromotingEvent.XmppError(detail);
+ }
+ break;
+ case Tag.MISSING_PLUGIN:
+ console.assert(detail, 'Missing PNaCl plugin last error string.');
+ this.raw_plugin_error = detail;
+ }
+
+ this.connection_error = error.toConnectionError();
+};
+
+/**
* @param {remoting.ChromotingEvent} event
* @return {boolean}
*/
« no previous file with comments | « no previous file | remoting/webapp/base/js/client_session.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698