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

Unified Diff: remoting/webapp/base/js/client_session_factory.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 | « remoting/webapp/base/js/client_session.js ('k') | remoting/webapp/base/js/client_session_unittest.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/base/js/client_session_factory.js
diff --git a/remoting/webapp/base/js/client_session_factory.js b/remoting/webapp/base/js/client_session_factory.js
index 249864e5bcfb71a1d445db5827d0ae692342ebe4..658d490c16f84d78a0447f33866022e05e2e29ab 100644
--- a/remoting/webapp/base/js/client_session_factory.js
+++ b/remoting/webapp/base/js/client_session_factory.js
@@ -52,7 +52,8 @@ remoting.ClientSessionFactory.prototype.createSession =
var clientPlugin;
function OnError(/** !remoting.Error */ error) {
- logError(logger, error);
+ logger.logSessionStateChange(
+ remoting.ChromotingEvent.SessionState.CONNECTION_FAILED, error);
base.dispose(signalStrategy);
base.dispose(clientPlugin);
throw error;
@@ -64,14 +65,12 @@ remoting.ClientSessionFactory.prototype.createSession =
return remoting.identity.getUserInfo();
}).then(function(/** {email: string, name: string} */ userInfo) {
logger.logSessionStateChange(
- remoting.ChromotingEvent.SessionState.SIGNALING,
- remoting.ChromotingEvent.ConnectionError.NONE);
+ remoting.ChromotingEvent.SessionState.SIGNALING);
return connectSignaling(userInfo.email, token);
}).then(function(/** remoting.SignalStrategy */ strategy) {
signalStrategy = strategy;
logger.logSessionStateChange(
- remoting.ChromotingEvent.SessionState.CREATING_PLUGIN,
- remoting.ChromotingEvent.ConnectionError.NONE);
+ remoting.ChromotingEvent.SessionState.CREATING_PLUGIN);
return createPlugin(that.container_, that.requiredCapabilities_);
}).then(function(/** remoting.ClientPlugin */ plugin) {
clientPlugin = plugin;
@@ -124,31 +123,4 @@ function createPlugin(container, capabilities) {
});
}
-/**
- * Converts |e| to remoting.ChromotingEvent.ConnectionError and logs
- * it to the telemetry service.
- *
- * TODO(kelvinp): Move this block to remoting.SessionLogger and consolidate
- * the code path with xmpp_error.
- *
- * @param {remoting.SessionLogger} logger
- * @param {remoting.Error} e
- */
-function logError(logger, e) {
- var error = remoting.ChromotingEvent.ConnectionError.UNEXPECTED;
-
- if (e instanceof remoting.Error) {
- error = e.toConnectionError();
-
- if (e.hasTag(remoting.Error.Tag.MISSING_PLUGIN)) {
- var pluginError = /** @type {string} */ (e.getDetail());
- console.assert(Boolean(pluginError), 'Missing plugin error string.');
- logger.setPluginError(pluginError);
- }
- }
-
- logger.logSessionStateChange(
- remoting.ChromotingEvent.SessionState.CONNECTION_FAILED, error);
-}
-
})();
« no previous file with comments | « remoting/webapp/base/js/client_session.js ('k') | remoting/webapp/base/js/client_session_unittest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698