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

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

Issue 1413923015: [Chromoting] Fix telemetry error in remoting.It2MeActivity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Rename_error_field
Patch Set: 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/it2me_activity.js
diff --git a/remoting/webapp/crd/js/it2me_activity.js b/remoting/webapp/crd/js/it2me_activity.js
index c05d2192eacb686fc45c9f4e50638416754d38e7..1e69c63f2198053543c0a8969deea5a6112b3d9b 100644
--- a/remoting/webapp/crd/js/it2me_activity.js
+++ b/remoting/webapp/crd/js/it2me_activity.js
@@ -46,28 +46,41 @@ remoting.It2MeActivity.prototype.dispose = function() {
remoting.It2MeActivity.prototype.start = function() {
var that = this;
+ var SessionState = remoting.ChromotingEvent.SessionState;
this.logger_ = this.createLogger_();
- this.logger_.logSessionStateChange(
- remoting.ChromotingEvent.SessionState.STARTED);
+ this.logger_.logSessionStateChange(SessionState.STARTED);
+ console.assert(
+ !this.desktopActivity_, 'Zombie DesktopActivity from previous session');
+ base.dispose(this.desktopActivity_);
this.desktopActivity_ =
new remoting.DesktopRemotingActivity(this, this.logger_);
+ function onError(/** remoting.Error */ error) {
+ if (error.isCancel()) {
+ that.logger_.logSessionStateChange(SessionState.CONNECTION_CANCELED);
+ remoting.setMode(remoting.AppMode.HOME);
+ } else {
+ that.logger_.logSessionStateChange(SessionState.CONNECTION_FAILED, error);
+ that.showErrorMessage_(error);
+ }
+
+ base.dispose(that.desktopActivity_);
+ that.desktopActivity_ = null;
+ }
+
+ var sessionStart = Date.now();
+
this.accessCodeDialog_.show().then(function(/** string */ accessCode) {
+ that.logger_.setAuthTotalTime(Date.now() - sessionStart);
that.desktopActivity_.getConnectingDialog().show();
return that.verifyAccessCode_(accessCode);
}).then(function() {
return remoting.HostListApi.getInstance().getSupportHost(that.hostId_);
}).then(function(/** remoting.Host */ host) {
that.connect_(host);
- }).catch(remoting.Error.handler(function(/** remoting.Error */ error) {
- if (error.hasTag(remoting.Error.Tag.CANCELLED)) {
- remoting.setMode(remoting.AppMode.HOME);
- } else {
- that.showErrorMessage_(error);
- }
- }));
+ }).catch(remoting.Error.handler(onError));
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698