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

Unified Diff: remoting/webapp/crd/js/client_session.js

Issue 689473004: Add connection type to connection stats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed typo. Created 6 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/crd/js/log_to_server.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/client_session.js
diff --git a/remoting/webapp/crd/js/client_session.js b/remoting/webapp/crd/js/client_session.js
index 16eaf1843bc1056b8848043befa7acf2deb19bad..53fa988557e6fa5fe13765d9168d1839d4022da9 100644
--- a/remoting/webapp/crd/js/client_session.js
+++ b/remoting/webapp/crd/js/client_session.js
@@ -106,7 +106,7 @@ remoting.ClientSession = function(signalStrategy, container, hostDisplayName,
this.remapKeys_ = '';
/** @private */
this.hasReceivedFrame_ = false;
- this.logToServer = new remoting.LogToServer(signalStrategy);
+ this.logToServer = new remoting.LogToServer(signalStrategy, mode);
/** @private */
this.signalStrategy_ = signalStrategy;
@@ -528,11 +528,7 @@ remoting.ClientSession.prototype.onPluginInitialized_ = function(initialized) {
}
this.plugin_.setOnOutgoingIqHandler(this.sendIq_.bind(this));
- this.plugin_.setOnDebugMessageHandler(
- /** @param {string} msg */
- function(msg) {
- console.log('plugin: ' + msg.trimRight());
- });
+ this.plugin_.setOnDebugMessageHandler(this.onDebugMessage_.bind(this));
this.plugin_.setConnectionStatusUpdateHandler(
this.onConnectionStatusUpdate_.bind(this));
@@ -605,7 +601,7 @@ remoting.ClientSession.prototype.disconnect = function(error) {
// The plugin won't send a state change notification, so we explicitly log
// the fact that the connection has closed.
- this.logToServer.logClientSessionStateChange(state, error, this.mode_);
+ this.logToServer.logClientSessionStateChange(state, error);
this.error_ = error;
this.setState_(state);
};
@@ -838,6 +834,19 @@ remoting.ClientSession.prototype.sendIq_ = function(message) {
/**
* @private
+ * @param {string} msg
+ */
+remoting.ClientSession.prototype.onDebugMessage_ = function(msg) {
+ var isConnectionTypeMessage = msg.match(
+ /^Channel (.*) using (.*) connection.$/);
+ if (isConnectionTypeMessage) {
+ this.logToServer.setConnectionType(isConnectionTypeMessage[2]);
+ }
+ console.log('plugin: ' + msg.trimRight());
+};
+
+/**
+ * @private
* @param {Element} message
*/
remoting.ClientSession.prototype.onIncomingMessage_ = function(message) {
@@ -1035,7 +1044,7 @@ remoting.ClientSession.prototype.setState_ = function(newState) {
this.state_ == remoting.ClientSession.State.FAILED) {
state = remoting.ClientSession.State.CONNECTION_DROPPED;
}
- this.logToServer.logClientSessionStateChange(state, this.error_, this.mode_);
+ this.logToServer.logClientSessionStateChange(state, this.error_);
if (this.state_ == remoting.ClientSession.State.CONNECTED) {
this.createGnubbyAuthHandler_();
this.createCastExtensionHandler_();
@@ -1226,7 +1235,7 @@ remoting.ClientSession.prototype.getPerfStats = function() {
* @param {remoting.ClientSession.PerfStats} stats
*/
remoting.ClientSession.prototype.logStatistics = function(stats) {
- this.logToServer.logStatistics(stats, this.mode_);
+ this.logToServer.logStatistics(stats);
};
/**
« no previous file with comments | « no previous file | remoting/webapp/crd/js/log_to_server.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698