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

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..a07c36e38dfe85046add12b5116e72046c889d4a 100644
--- a/remoting/webapp/crd/js/it2me_activity.js
+++ b/remoting/webapp/crd/js/it2me_activity.js
@@ -46,28 +46,39 @@ 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);
+ base.dispose(this.desktopActivity_);
Jamie 2015/11/09 18:16:45 Do you ever expect desktopActivity to be non-null?
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